Skip to content

Tool for migrating CloudSQL instances between different projects

License

Notifications You must be signed in to change notification settings

ichbinfrog/cloudsqlmigrate

Repository files navigation

CloudSQL Migration utility

A tool for quickly migrating CloudSQL instances to each other.

To run a migration, simply run:

migrate \
    --src-project= \
    --src-instance= \
    --dst-project= \
    --dst-instance=S

Under the hood it heavily uses the CloudSQL Admin API to:

This approach is favorable the classic sql export-import flow for a couple reasons:

  • It's much faster ⚡. The time to create and restore snapshots are quite well optimized is inversely proportional to the instance's resources.

  • It's safer 🔒 as data does not persist on a temporary bucket but on snapshots that are best practices to have anyways. On top of that, users with their credentials, database schemas, permissions, extensions are preserved and transferred without issue from the source to the target instance.

  • It's simpler 👶; Not having to deal with the complexities of dumping and importing SQL (e.g. extension, user permission and other issues that arises from the lack of control of the dump generated)

  • Does not stress the source instance if automated backups is enabled. The latter is incremental thus generating a new snapshot from the last point in time is significantly faster and less resource intensive than performing an sql dump.

Getting started

Build your and install own binary with:

go install github.com/ichbinfrog/cloudsqlmigrate

About

Tool for migrating CloudSQL instances between different projects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published