Project: YugabyteDB (App Definition and Development / Database)
File: multicloud-migration.md

title: Multi-cloud Migration headerTitle: Multi-cloud migration linkTitle: Multi-cloud migration description: Migrate your data between different clouds headcontent: Migrate your data between different clouds menu: v2.18: identifier: multicloud-migration parent: build-multicloud-apps weight: 200 type: docs Moving applications from an on-premises data center to a public cloud, or from one public cloud to another, is a non-trivial task. YugabyteDB provides a simple pattern for you to accomplish this task with comparative ease. To illustrate, consider a scenario where you have a 3-node cluster deployed in AWS (us-west) and would like to move to GCP (us-central). To accomplish the migration, use the feature, which provides one-way asynchronous replication from one universe to another. In this case, AWS will be the source and the GCP universe will be the target. Set up the Source universe in AWS and the Target universe in GCP using the following setup procedures. <!-- begin: nav tabs --> {{<nav/tabs list="local,anywhere" active="local"/>}} {{<nav/panels>}} {{<nav/panel name="local" active="true">}} {{<note>}} To set up a local universe, refer to <a href="../../../explore/#set-up-yugabytedb-universe">Set up a YugabyteDB universe</a>. {{</note>}} <!-- END: local cluster setup instructions --> {{</nav/panel>}} <!-- xCluster not currently supported in YBM {{<nav/panel name="cloud">}} {{<setup/cloud>}} {{</nav/panel>}} --> {{<nav/panel name="anywhere">}} {{<note>}} To set up a universe in YugabyteDB Anywhere, refer to . {{</note>}} <!-- END: YBA cluster setup instructions --> {{</nav/panel>}} {{</nav/panels>}} <!-- end: nav tabs --> When finished, note down the universe-uuids of the `source` and `target` universes. Now that the GCP universe has been set up, you need to populate the data from your AWS universe. This is typically referred to as Bootstrapping. {{<tip title="More Details">}} For detailed instructions, see . {{</tip>}} The basic flow of bootstrapping is as follows: Create a checkpoint for all the tables in the AWS universe. For example: ```bash ./bin/yb-admin -masteraddresses <AWSuniversemasteraddresses> \ bootstrapcdcproducer <commaseparatedsourceuniversetable_ids> ``` Take a backup of the tables on the AWS universe and restore them to the GCP universe. See

This ensures that the current data in your AWS universe is correctly copied over to the GCP universe. After your data has been pre-populated from the AWS universe to the GCP universe, you need to set up the replication stream from the AWS to the GCP universe. {{<tip title="More Details">}} For detailed instructions on how to set up replication, see . {{</tip>}} A simple way to set up replication is as follows: ```bash ./bin/yb-admin -masteraddresses <GCPuniversemasteraddresses> setupuniversereplication \ <AWSuniverseuuid><replicationstreamname> <AWSuniversemasteraddresses> \ <commaseparatedsourceuniversetableids> <commaseparatedbootstrapids> ``` Any data changes to the AWS universe are automatically applied to the GCP universe. NOTE: For this example, DDL changes have to be applied manually. After the new universe has caught up with the data from the old universe, you can switch over to the new universe. {{<tip title="More Details">}} For detailed instructions on how to do planned switchover, see . {{</tip>}} The basic flow of switchover is as follows: Verify that the data has been successfully migrated using basic techniques like validating the number of rows of the corresponding tables in both universes are the same (for example, `SELECT count(*)`). Stop the application traffic to the old universe to ensure no more data changes are attempted. Pause the replication on the new universe. Promote the GCP universe to `ACTIVE`. For example: ```bash ./bin/yb-admin \ -masteraddresses <GCPmaster_addresses> \ -certsdirname <cert_dir> \ changexclusterrole ACTIVE ``` You can point your applications to the new universe in GCP and then stop the replication, as shown in the following illustration. At this point, you can either tear down your AWS universe or convert it to a stand-by cluster for disaster recovery, by setting up an replication from the new GCP universe to the AWS universe. You can use the same procedure to migrate data from your on-premises data centers to the public cloud. Moving from on-premises data centers to a public cloud requires a more cautious approach. You might want to consider a Hybrid cloud before moving completely to a public cloud. Refer to for more details.