You are migrating your 2 TB on-premises PostgreSQL cluster to Compute Engine. You want to set up your new environment in an Ubuntu virtual machine instance in Google Cloud and seed the data to a new instance. You need to plan your database migration to ensure minimum downtime. What should you do?
A. 1. Take a full export while the database is offline.
2. Create a bucket in Cloud Storage.
3. Transfer the dump file to the bucket you just created.
4. Import the dump file into the Google Cloud primary server.
B. 1. Take a full export while the database is offline.
2. Create a bucket in Cloud Storage.
3. Transfer the dump file to the bucket you just created.
4. Restore the backup into the Google Cloud primary server.
C. 1. Take a full backup while the database is online.
2. Create a bucket in Cloud Storage.
3. Transfer the backup to the bucket you just created.
4. Restore the backup into the Google Cloud primary server.
5. Create a recovery.conf file in the $PG_DATA directory.
6. Stop the source database.
7. Transfer the write ahead logs to the bucket you created before.
8. Start the PostgreSQL service.
9. Wait until Google Cloud primary server syncs with the running primary server.
D. 1. Take a full export while the database is online.
2. Create a bucket in Cloud Storage.
3. Transfer the dump file and write-ahead logs to the bucket you just created.
4. Restore the dump file into the Google Cloud primary server.
5. Create a recovery.conf file in the $PG_DATA directory.
6. Stop the source database.
7. Transfer the write-ahead logs to the bucket you created before.
8. Start the PostgreSQL service.
9. Wait until the Google Cloud primary server syncs with the running primary server.
Answer
C