Changing GAE region

57 views
Skip to first unread message

ChiaHow Ng

unread,
Jul 31, 2019, 10:31:25 AM7/31/19
to Google App Engine

Hi, 

We have a project on asia-east1 which already runs for years, and have huge amount of data on Cloud SQL.

Recently we are about to try something on GAE, and accidentally we created the app in us-central.

Is there anyway we can undo this and re-create the App in asia-east2? is kind of impossible for us to migrate to another project purely because of the amount of data and resources we have setup in the current project.

Thanks.

David (Cloud Platform Support)

unread,
Jul 31, 2019, 2:15:14 PM7/31/19
to Google App Engine

Hello,


Unfortunately you can’t change the location for your app once created. If you are interested in a feature that would allow you to do this, you can follow this feature request. As a workaround, you may be able to export the Data of your Cloud SQL and import it back to your other Cloud SQL instance.


ChiaHow Ng

unread,
Jul 31, 2019, 10:26:03 PM7/31/19
to Google App Engine
We have huge amount of data in current project Cloud SQL, and is a 24/7 busy portal, is there any seamless migration solution for Cloud SQL between projects?

Can we do like setup a slave in another project, when is up to date, we just promote it to master in another project?

David (Cloud Platform Support)

unread,
Aug 1, 2019, 4:00:18 PM8/1/19
to Google App Engine

You can have a read replica on another project but you won’t be able to do the migration process with SSL/TLS security enabled.


For the migration to work, you would need to allow traffic from everywhere first, so in the Cloud SQL dashboard page, you would need to activate public IP and add the following IP range: 0.0.0.0/0. This will allow everything to connect to this instance.


1-Go to create replica in your Y project, click on "Begin migration" and on "Public IP address of source" add the public IP of the Cloud SQL instance you prepared to migrate previously. If you are using MySQL, the port would be 3306, and if you would use Postgres, it would be 5432. 

2-Fill the rest of fields and click on “Next”.

3-This step is like configuring any Cloud SQL machine, but it is recommended that you create a similar one. The difference is that you need to upload a dump file of your Cloud SQL instance master (i.e. the one you want to replicate). 

4-Once this Cloud SQL replica is created, you can copy the public IP of this Cloud SQL replica and add it to the connection section on your Cloud SQL master and then delete the IP range 0.0.0.0/0 you created previously for more security in your Cloud SQL instance again. 

5-That being said, you can promote this read replica to master following the documentation


Another option would be running an export and importing it back.

You can run this gcloud command for this:

gcloud sql export sql instance1 gs://<bucket>/dump.sql --database=db1 --project project1 && gcloud sql import sql instance2 gs://<bucket>/dump.sql --database=db2 --project project2 


If you decide to do this, make sure you enter the same bucket for importing and exporting and make sure you give the Cloud SQL service account permissions to access the bucket which you can find in your Cloud SQL dashboard page.

Reply all
Reply to author
Forward
0 new messages