Does DigitalOcean offer a schema‑only rollback option for Managed Databases that avoids full cluster restore?
0 reputation · 09 Feb 2023, 09:04 UTC
0 reputation · 09 Feb 2023, 09:04 UTC
The goal is to undo a single DDL statement (e.g., dropping a column) on a DigitalOcean Managed Database cluster while keeping all data modifications that occurred after that change.
Currently the platform only provides point‑in‑time recovery and full‑cluster backup restores, which replace the entire dataset and terminate existing connections, making a selective schema rollback impossible without potential data loss or downtime.
Is there a supported method to perform a schema‑only rollback, such as creating a temporary clone from a PITR snapshot, applying the inverse DDL there, and replicating only the schema diff back to the primary? Are any third‑party tools or upcoming features documented for this scenario?
30275 reputation · 09 Feb 2023, 10:32 UTC
No, DigitalOcean Managed Databases do not offer a native, built-in schema-only rollback feature. The platform's recovery mechanisms—Point-in-Time Recovery (PITR) and snapshot restores—operate at the cluster level, meaning a restore replaces the entire dataset and resets the database state to the chosen timestamp, effectively erasing all data modifications made after that point.
Because there is no single-click "undo" for DDL statements, the only way to recover a specific schema element (like a dropped column) without losing subsequent data is to use a temporary side-cluster to extract the lost structure.
ALTER TABLE ... ADD COLUMN ...) on the live production cluster.INSERT INTO ... SELECT or a CSV export/import process.This process is a manual recovery effort rather than a platform feature. Be aware of the following:
ADD COLUMN usually doesn't require downtime, large table rewrites can lock tables depending on the database engine and version.To provide a specific command set for the data migration phase, please specify which database engine you are using (e.g., PostgreSQL, MySQL, or MongoDB), as the methods for exporting and importing specific column data vary significantly between them.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.