How to restore a Managed Database to a point in time
Restoring a Managed Database to a point in time creates a new service from the database's backups, as it was at the time you choose. The original service isn't changed, and it doesn't need to be running. You can restore into the same location from the Control Panel, or into any location with the API. This works for Managed PostgreSQL and Managed MySQL.
What the restored service has
- The data up to the time you choose.
- The same users and passwords as the original service.
- The same properties and termination protection setting as the original service.
- A new hostname. Update your application's connection settings to use it.
- With the API, the location, plan and networks you choose. From the Control Panel, the original service's location, plan and networks.
Choose the time
You can restore to any point within the database's backup retention, which depends on its backup tier. Give the time in UTC. See Managed PostgreSQL backups and Managed MySQL backups.
The time can't be later than the last write to the original service. If it is, the new service goes to the error state. For Managed PostgreSQL, the service's state_error in the API shows when the last write was. Delete the failed service and restore again with an earlier time. With the API, you can also leave out clone_time to restore the newest data.
Restore the database
- Open the database service and go to its Backups tab.
- Click Clone from backups.
- Under Point In Time, choose the month, day, hour and minute to restore to, in UTC. The new service has the data up to the start of that minute.
- Enter a Service name and a Hostname prefix for the new service, or keep the suggested ones, and click Clone.
The new service is in the same location as the original service, with the same plan and networks.
Connect your application
Use the new service's hostname in your application's connection settings. If a server on that network can't reach the new service, restart it so that it gets the route to the service. When you no longer need the original service, you can delete it. If its termination protection is on, turn it off first. Termination protection also blocks powering the service off.
Moving a service on an SDN Private Network to another location is not supported. Restore it into the new location instead.
