Stay organized with collections Save and categorize content based on your preferences.
This quickstart shows you how to use Database Migration Service to migrate data to AlloyDB for PostgreSQL. The resources created in this quickstart typically cost less than one dollar (USD), assuming you complete the steps, including the clean up, in a timely manner.
Before you beginIn the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Make sure that billing is enabled for your Google Cloud project.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Make sure that billing is enabled for your Google Cloud project.
Enable the Database Migration Service API.
Database Migration Service offers a variety of source database options and connectivity methods. Different sources work better with some connectivity methods than with others. In this quickstart, we assume that you're using a standalone PostgreSQL database in an environment where you can configure your network to add an inbound firewall rule. The source database can be on-premises or in a cloud provider. Because we can't know the specifics of your environment, we can't provide detailed steps when it comes to your networking configuration.
In this quickstart, you'll select PostgreSQL for the Source database engine, AlloyDB for PostgreSQL for the Destination database engine and VPC peering as the networking method.
Create a source connection profile By creating a connection profile, you're creating a record that contains information about the source database. Database Migration Service uses the information in the connection profile to migrate data from your source database to the destination AlloyDB database instance.Go to the Database Migration Service Connection profiles page in the Google Cloud console.
Go to the Database Migration Service Connection Profiles Page
Click CREATE PROFILE.
On the Create a connection profile page, from the Profile role list, select Source.
From the Database engine list, select one of the following classification types of your source database:
For this quickstart, select PostgreSQL.
My Connection Profile
.In the Connection profile region section of the page, select the region where you want to save the connection profile.
Connection profiles, like all resources, are saved in a region. Region selection doesn't impact which migration jobs can use them, or which regions can connect to the data location itself, but can impact availability in the case of regional downtime.Creating a migration job includes:
Go to the Database Migration Service Migration jobs page in the Google Cloud console.
Click CREATE MIGRATION JOB.
In the Migration job name field, enter a name for the migration job, such as My Migration Job
.
Keep the auto-generated Migration job ID.
Open the Source database engine drop-down list and select the classification type of your source database. In this quickstart, select AlloyDB for PostgreSQL.
Select the Destination region where the destination instance is to be created.
Set the Migration job type to "Continuous" because you want ongoing changes in your source database to be migrated to the destination AlloyDB database instance.
Review the required prerequisites that are generated automatically to reflect how the environment must be prepared for a migration job. These prerequisites can include how to configure the source database and how to connect it to the destination AlloyDB database instance. It's best to complete these prerequisites at this step, but you can complete them at any time before you test the migration job or start it. For more information about these prerequisites, see Configure your source.
Click SAVE & CONTINUE.
Open the Select source connection profile drop-down list and select the connection profile that you created.
Click SAVE & CONTINUE.
Clusters are the top-level resource in AlloyDB. To create a destination cluster:
postgres
user. You will need the password to log in to your database.--force
option. Set up connectivity
You can select the databases that you want to migrate.
All databases that exist on the source are selected for migration.
Review the settings you chose for the migration job.
Click TEST JOB to verify that the source has been configured correctly, that the source and destination instances are able to communicate with each other, and that the migration job is valid.
Verify that you see the "Tests passed successfully!" status.
If the test fails, then you can address the problem in the appropriate part of the flow, and return to re-test.
Click CREATE & START JOB to create the migration job and start it immediately.
Click START in the subsequent dialog box.
In the Migration jobs page, verify that your migration job has a status of "Starting". After a few minutes, confirm that the status changes to "Running".
In this section, you confirm that Database Migration Service used the migration job to migrate data from your source database instance to the destination AlloyDB database instance.
\list
to list the databases and verify that you see your source database instance.\connect SOURCE_DB_NAME
because you want to see the tables associated with this database instance. The name of the prompt changes from postgres
to SOURCE_DB_NAME.\dt
to see the tables of this instance.GRANT alloydbexternalsync to USER;
because you want to give this user permission to access the data in the tables of this instance.
Replace USER with the name of the user you used to connect to the destination database instance.
SELECT * from TABLE_NAME;
to see the information that's replicated from a table in your source database instance.This confirms that Database Migration Service migrated the data.
You're ready to promote the migration job. As a result, the destination AlloyDB database instance replaces the source database instance as the primary database.
Return to the Migration jobs page.
Click the migration job that you want to promote. The Migration job details page appears.
Wait for the replication delay to trend toward zero.
Stop all writes to the source database.
You must stop all writes to the source database because, by promoting the migration job, the destination AlloyDB database will become your primary database.Wait until the replication delay is at zero.
Click the migration job that you want to promote. This job should have a status of "Running".
Click PROMOTE to promote the migration job.
Click PROMOTE again in the subsequent dialog box.
Verify that the migration job has a status of "Promote in progress". After a few minutes, confirm that the status changes to "Completed".
Your new AlloyDB database instance is ready to use.
Clean upTo avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-02 UTC."],[[["This quickstart guides you through migrating data from a PostgreSQL database to AlloyDB for PostgreSQL using Database Migration Service."],["The process includes creating a source connection profile, setting up a migration job, and defining settings for both the source and destination databases."],["Connectivity between the source and destination is established using VPC peering, with the guide highlighting the need to configure network settings for standalone databases."],["You will create a destination AlloyDB cluster and a primary instance, configuring settings such as cluster ID, password, network, and instance machine type."],["After testing and running the migration job, you'll verify the migration by connecting to the AlloyDB cluster and confirming the presence of the source database and its tables before promoting the job, turning the AlloyDB database into the primary database."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4