Migrating Cloud SQL PostgreSQL PITR Logs to Cloud Storage

PCDBE By islever Editorial Last updated

Evaluate appropriate database solutions on Google Cloud. Optimize database cost and performance in Google Cloud.

Short answer

C Upgrade to Enterprise Plus Edition to automatically migrate PITR logs to Cloud Storage while preserving existing recovery capabilities.

Question

You are running a Cloud SQL for PostgreSQL 13 Enterprise Edition instance. During an audit, you discovered that the write-ahead logs used for point-in-time recovery (PITR) are stored on disk. You need to store PITR logs in a Cloud Storage bucket going forward. How should you do this without compromising recoverability or losing the current PITR logs?
  1. Clone the instance. Create a new instance with PITR retention set to 30 days.
  2. Change the transaction logs (WAL) retention period.
  3. Upgrade to Enterprise Plus Edition. Correct Answer
  4. Disable PITR, then enable PITR.

Key Takeaways

The exam tests knowledge that WAL storage location is tied to the instance edition; only Enterprise Plus uses Cloud Storage for WALs.

Learn how to move Cloud SQL for PostgreSQL PITR logs from disk to Cloud Storage by upgrading to Enterprise Plus Edition, ensuring no data loss.

Common mistake: Choosing to clone the instance (A) or disable/re-enable PITR (D), which either fails to change the storage backend or risks losing historical recovery points.

Expert Analysis

The question requires migrating Point-in-Time Recovery (PITR) logs from local persistent disk to Cloud Storage for a PostgreSQL Enterprise Edition instance. According to Google Cloud documentation, the storage location of Write-Ahead Logs (WAL) is determined by the edition of the Cloud SQL instance. Specifically, Enterprise Plus instances automatically store WALs in Cloud Storage to reduce latency and improve performance, whereas standard Enterprise instances store them on the instance's local disk.

To achieve this migration without losing current PITR logs or compromising recoverability, you must upgrade the instance edition. Option C suggests upgrading to Enterprise Plus Edition. This is the correct action because the upgrade process preserves the existing data and WAL history while switching the storage mechanism for future logs to Cloud Storage. The comments correctly identify that this edition change triggers the automatic switch in log storage location.

Option A (Cloning) is incorrect because cloning creates a copy but does not inherently change the underlying edition's default storage behavior unless explicitly configured during creation, and it introduces unnecessary complexity and potential downtime compared to an in-place upgrade. Option B (Changing retention period) only affects how long logs are kept, not where they are stored. Option D (Disabling and re-enabling PITR) is risky; disabling PITR typically involves deleting existing WAL logs, which would compromise the ability to recover to points in time prior to the re-enablement, thus violating the constraint of not losing current logs.

Official Reference

https://cloud.google.com/sql/docs/postgres/backup-recovery/pitr#log-storage-for-pitr

This link opens the official vendor documentation in a new tab.

Exam Strategy

When a question asks about changing infrastructure defaults like log storage or networking, check if the feature is tied to a specific tier or edition. Upgrading tiers often enables new capabilities automatically without manual configuration steps like cloning or toggling features.

Frequently Asked Questions

Does upgrading from Enterprise to Enterprise Plus cause downtime?

Upgrading the edition of a Cloud SQL instance is generally a non-disruptive operation. However, it is best practice to verify the specific maintenance window settings.

Can I use Cloud Storage for WALs with Standard Edition?

No, Standard and Enterprise editions store WALs on the instance's local persistent disk. Only Enterprise Plus supports native Cloud Storage retention for WALs.

More PCDBE FAQ →

Community Votes

C
60%
A
20%
D
20%

60% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 6 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 6

  1. yokoyan 👍 3 Answered C
    C is correct
  2. yokoyan 👍 2
    https://cloud.google.com/sql/docs/postgres/backup-recovery/pitr#log-storage-for-pitr
  3. AwesomeGCP 👍 1 Answered C
    Why Option C is CorrectNative Cloud Storage Retention for Enterprise Plus: All Cloud SQL Enterprise Plus edition instances store write-ahead logs (WAL) used for point-in-time recovery (PITR) directly in Cloud Storage rather than on the persistent instance disk. Preserving Recoverability and Existing Logs: Performing an in-place upgrade from Enterprise Edition to Enterprise Plus Edition automatically switches the WAL storage location to Cloud Storage going forward without deleting your existing transaction logs or compromising the existing PITR recovery window.
  4. Chamiel1028 👍 1 Answered A
    A: Clone + configure PITR retention Option A: Clone the instance and create a new instance with PITR retention set to Cloud Storage Step 1: Clone the existing instance → preserves all current data and WAL logs Step 2: On the cloned instance, enable PITR with retention settings → Cloud SQL automatically stores WAL logs in Cloud Storage Outcome: No loss of existing WAL logs Future PITR logs go to Cloud Storage Recoverability is maintained This satisfies both security/compliance and data retention requirements.
  5. iwork 👍 1 Answered D
    Google recommends to upgrade version to switch log storage location automaticly. You also can migrate logs without downtime using gcloud command. However, it also depends on retention period (they recommend to switch it to 1 day). For more details see the link beliw: https://cloud.google.com/sql/docs/postgres/backup-recovery/pitr
Show 1 more comment
  1. AwesomeGCP 👍 1 Answered C
    The correct answer is C. Upgrade to Enterprise Plus Edition.

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

← Back to PCDBE Study Guide