Terriermon - Digimon

18. Migrating to AlloyDB from PostgreSQL Using Database Migration Service

2024. 11. 26. 08:40클라우드/GCP

Task 1. Verify Data in the Source Instance for migration

 

sudo -u postgres psql
\dt

 

 

 

select count (*) as countries_row_count from countries;
select count (*) as departments_row_count from departments;
select count (*) as employees_row_count from employees;
select count (*) as jobs_row_count from jobs;
select count (*) as locations_row_count from locations;
select count (*) as regions_row_count from regions;

 

 

Task 2. Create a Database Migration Service connection profile for a stand-alone PostgreSQL database

Create a new connection profile for the PostgreSQL source instance

 

 

Task 3. Create and start a continuous migration job

Create a new continuous migration job

 

Define the source instance

 

 

Create the destination instance

 

 

 

Test and start the continuous migration job

 

완료되면 create job

 

Review the status of the continuous migration job

 

 

 

Task 4. Confirm data load in the AlloyDB for PostgreSQL Instance

 

 

export ALLOYDB=ALLOYDB_ADDRESS
echo $ALLOYDB  > alloydbip.txt
psql -h $ALLOYDB -U postgres
\dt
select count (*) as countries_row_count from countries;
select count (*) as departments_row_count from departments;
select count (*) as employees_row_count from employees;
select count (*) as jobs_row_count from jobs;
select count (*) as locations_row_count from locations;
select count (*) as regions_row_count from regions;
select region_id, region_name from regions;

 

 

 

sudo -u postgres psql  
insert into regions values (5, 'Oceania');
select region_id, region_name from regions;

 

 

select region_id, region_name from regions;

 

 

참고 : https://www.cloudskillsboost.google/focuses/100854?parent=catalog

 

Migrating to AlloyDB from PostgreSQL Using Database Migration Service | Google Cloud Skills Boost

In this lab, you migrate a stand-alone PostgreSQL database (running on a virtual machine) to AlloyDB for PostgreSQL using a continuous Database Migration Service job with VPC peering for connectivity.

www.cloudskillsboost.google

 

반응형