Eljo George
Eljo George

Reputation: 55

How to switch (migrate) to Google Cloud SQL from DataStore?

I have a Google App Engine Java application, which uses Appengine datastore for its persistence (Using JPA and Datanucleus). Now I want to migrate my backend(database) to Google Cloud SQL. I have already created cloud sql account and instance. I also granted permission for my GAE app to use this instance.

Now, how I can i rewrite my app or what are the changes I should make to my application, in order to migrate to cloud sql.

Any good tutorial is there for it? Any help is greatly welcomed.

Upvotes: 0

Views: 1571

Answers (1)

Dan Holevoet
Dan Holevoet

Reputation: 9183

I would suggest following Using Google Cloud SQL with App Engine Java SDK. Once you've configured an example database, create new tables for the entities in your datastore.

For the actual data migration you have a few possible routes:

  • Download your datastore locally, manipulate the entries into SQL INSERT statements, and upload them to Cloud SQL
  • Write a script that reads through the datastore and writes rows to your SQL datastore (most likely using a task queue and datastore cursor)
  • Ignore the old data in your app and start from scratch

Upvotes: 1

Related Questions