Search code examples
google-cloud-platformgcloud

Is there an easy way to clone a SQL-instance between projects in Google cloud?


I'm wondering if there exists an easy way to clone sql-instances between projects in Google Cloud. I understand that i can export the data to a bucket see img_1, but i find that a bit cumbersome ..

img_1

If anyone has a easy way to do this, it would be much appreciated.


Solution

  • There is no “quick” way to Clone your SQL instance between projects. A clone operation essentially needs to bundle these 3 operations into 1, and hence why it is possible to have a clone within a project but not outside the project.

    • The data from the origin
    • The instance to receive said data
    • How to transfer this data

    A Cloud SQL clone can only occur within the project. What you are looking for is a backup and restore to a different project, effectively cloning the instance but manually.

    There is an open feature request open for this type of request. I suggest that you “+1” yourself on that so that you are kept up to date on the development of the feature.

    If you want to have “clone” your instance to a different project, you have 2 options:

    1. SQL dump > GCS > Import dump from GCS into Cloud SQL
    2. Restore your instance to a different project

    Feel free to ask questions as you wish.