Code Monkey home page Code Monkey logo

cloudsqlmigrate's Introduction

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

cloudsqlmigrate's People

Contributors

ichbinfrog avatar

Stargazers

Alessandro Pezzè avatar  avatar

Watchers

 avatar

cloudsqlmigrate's Issues

Implement e2e test suite

In e2e/tests/, the code should:

  • fetch the source and destination project and instances from environment variables
  • run a migration similarly to main.go and reuse postflight checks

For the CI:

  • add github actions WID federation to the terraform code and make it optional
  • trigger e2e test on merges to main

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.