大网数据广告活动
服务器运维问答

Restoring a Digital Ocean managed Postgres database

· 52CE 我爱测

We recently moved our database cluster from self-hosted to Digital Ocean Managed Postgres. We would like to rollback the entire database to a recent point in time. The backups are available for up to a week According to the docs …

问题原文

原帖链接 · port5432 · CC BY-SA 4.0

We recently moved our database cluster from self-hosted to Digital Ocean Managed Postgres. We would like to rollback the entire database to a recent point in time.

The backups are available for up to a week

According to the docs we cannot directly restore the database from the backup:

When you restore from a backup, we create a new copy of your cluster’s primary node. You cannot restore directly into the primary node itself because this creates alternative timelines for the database that introduce unwarranted complexity in a managed service. By restoring into a new primary node, a single linear timeline history is preserved.

When the new cluster is restored, it is a parallel cluster (see image below), there does not seem to be any way to make it assume the connection parameters of the original cluster.

The only way forward we can see is to do a full export from the new parallel cluster and drop the original database and import from command line.

Is there another option here?

已采纳解答

原帖链接 · John Mahowald · CC BY-SA 4.0

Change the connection parameters for each application to point at the new database instance at the new point in time.

Fastest and least complexity on the database side. Adding a dump and restore may extend the restore time considerably. Avoids complexity and confusion with two points in time on the same instance. May be possible to keep the old instance for some time, to abort the restore.

More complexity on the application side, may need to configure or redeploy. Possibly not trivial, although should be possible, if say you were to switch database providers.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-12-01)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。