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 
<https://console.cloud.google.com/sql/migrate/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 
<https://cloud.google.com/sql/docs/mysql/replication/manage-replicas#promote-replica>
. 

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.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/2883092d-2dbf-43f9-9d33-10b759e1b54d%40googlegroups.com.

Reply via email to