Use a continuous Database Migration Service job and VPC peering to migrate a PostgreSQL database from a VM to Cloud SQL.
- Database Migration
- Migrate a database to Cloud SQL for PostgreSQL by using Database Migration Service
- VPC Network Peering
- connects two VPC networks: all subnets can use internal IPv4 addresses
- Each network must have a peering configuration setup and then the peering state changes to
ACTIVE
.
An example with gcloud
that lets cats talk to dogs:
gcloud compute networks peerings create cutecatspeering \
--network=catnet \
--peer-project dogsbriedev \
--peer-network dognet
gcloud compute networks peerings list
Repeat the process over in the dogsbriedev
project to create a similar peering configuration
- Q: How do you check the
ACTIVE
status?
Clean it up:
gcloud compute networks peerings delete cutecats \
--network catnet