简体   繁体   English

在数据存储区模式下从Google Datatore迁移到Firestore

[英]Migrating from Google Datatore To Firestore in Datastore mode

I was trying to find a step by step guide to migrate an existing project working with Datastore to the new Firebase in Datastore mode. 我试图找到逐步指南,以将使用数据存储的现有项目迁移到数据存储模式下的新Firebase。 If you do not want to wait for the Automatic migration to Firestore here is my experience with the migration. 如果您不想等待自动迁移到Firestore,这是我的迁移经验。

Documentation page "Exporting and Importing Entities" has the steps, but I struggled a bit figuring things out. 文档页面“导出和导入实体”中包含步骤,但是我很难弄清楚。 So I thought I'd share my experience. 所以我想我会分享我的经验。

Some notes to consider: 一些注意事项:

  • Be ware of cost/time if you have a huge database! 如果您拥有庞大的数据库,请注意成本/时间!
  • Yet to figure out the challenges of moving the application from Python 2.7 to Python 3 ( not entirely a datastore issue, this doc page may help! )! 但是要弄清楚将应用程序从Python 2.7迁移到Python 3的挑战( 不完全是数据存储问题, 此文档页面可能会有所帮助! )!
  1. From Google Console, create a new project 在Google控制台中,创建一个新项目
  2. gcloud config set project <your-old-project-id>
  3. Create a new bucket on Google Storage (on your old project) 在Google Storage 创建一个新存储桶(在您的旧项目上)
  4. Export your database to the newly created bucket gcloud datastore export gs://<your-new-bucket-name> (on your old project) 将数据库导出到新创建的存储桶gcloud datastore export gs://<your-new-bucket-name> (在您的旧项目上)

    Waiting for [projects/[your-old-project-id]/operations/AvcsdafSDFasdfI3MDQJGnRsdWFmZWQHEmVwb3J1Z S1zYm9qLW5asdfcsopEg] to finish...done. 等待[projects / [your-old-project-id] / operations / AvcsdafSDFasdfI3MDQJGnRsdWFmZWQHEmVwb3J1Z S1zYm9qLW5asdfcsopEg]完成...完成。

  5. From Google Console go to IAM page (still on your old project) 从Google控制台转到IAM页面 (仍在您的旧项目中)

  6. Add the new project service account account and grant " Cloud Datastore Import Export Admin " & " Storage Admin " permissions ( NOTE: for some reason when adding the " Storage viewer " only permission I got the below error, so I used the " Storage Admin " instead!) 添加新的项目服务帐户帐户并授予“ Cloud Datastore Import Export Admin ”和“ Storage Admin ”权限( 注意:由于某些原因,当添加“ Storage Viewer ”唯一权限时,出现以下错误,因此我使用了“ Storage Admin “代替!)

    "details: [new-project-service-account] @appspot.gserviceaccount.com does not have storage.buckets.get access to [new-project-id] .appspot.com." “详细信息: [new-project-service-account] @ appspot.gserviceaccount.com没有storage.buckets.get访问[new-project-id] .appspot.com。”

  7. Move to your new project gcloud config set project <your-NEW-project-id> 移至新项目gcloud config set project <your-NEW-project-id>

  8. Import the data from your storage bucket gcloud datastore import gs://<your-bucket-path>/[FILENAME].overall_export_metadata , when done you should see a message similar to export 从存储桶中导入数据gcloud datastore import gs://<your-bucket-path>/[FILENAME].overall_export_metadata ,完成后,您应该会看到类似于export的消息

    Waiting for [projects/[your-old-project-id]/operations/AaredafSDFa2otbmltZGEQCigSFmZWQHEmVwb3J1Z S1z2otbmltZGEQCigS] to finish...done. 等待[项目/ [您的旧项目ID] /操作/ AaredafSDFa2otbmltZGEQCigSFmZWQHEmVwb3J1Z S1z2otbmltZGEQCigS]完成...完成。

  9. Optional : feel free to remove the new project service account permission from the old project IAM page 可选 :随时从旧项目IAM页面中删除新的项目服务帐户权限

  10. If you browser to your new project Datastore page, you should see your migrated Entities 如果浏览到新项目的“数据存储”页面,则应看到已迁移的实体

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从数据存储区将数据迁移到Google Cloud Firestore - Migrating data to Google Cloud Firestore from Datastore AppEngine:将 Firestore 从本机模式切换到数据存储区模式 - AppEngine: Switch Firestore from Native to Datastore mode 将数据从Google数据存储(GAE)迁移到Google Cloud SQL - Migrating data from Google Datastore (GAE) to Google Cloud SQL 将图片迁移到Google App Engine数据存储区或Blobstore - migrating images to google app engine datastore or blobstore Google App引擎-将网站用户表从数据存储区迁移到mysql(CloudSQL) - Google app engine - migrating website user table from datastore to mysql (CloudSQL) 迁移到HRD数据存储区后,我迁移很晚(Google App Engine) - Migrating to HRD datastore, i was late with migration (Google App Engine) Google Cloud Datatore Go 客户端默认不关闭连接? - Google Cloud Datatore Go Client doesn't close the connection by default? 从 Google Dataflow 保存到 Google Datastore - Saving to Google Datastore from Google Dataflow Google App Engine数据存储区管理控制台-离线模式 - Google App Engine Datastore Admin Console - Offline mode 将应用程序从 GAE M/S 数据存储迁移到 HRD 的影响 - Impact of migrating app from GAE M/S datastore to HRD
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM