Dashboard

Backups

Restore a backup

Restore a database from a backup, and what happens to the data it replaces.

Restoring puts a database back to the state it was in when a backup was taken. It replaces everything in the database, so HCode backs up the current data first.

Restore a database

  1. Open your project and go to Backups.
  2. Click View files & restore on the database's schedule.
  3. Find the backup you want and click Restore. Only backups marked Ready can be restored.
  4. Check the file name next to Restore from: and click Restore.

The dashboard confirms with "Restore initiated successfully". The restore then runs in the background, and the dashboard doesn't show its progress.

You can also restore from the Databases page: click Manage backups on the database's card, then Restore next to a file, and confirm the prompt.

What happens during a restore

  1. HCode backs up the database as it is now. This backup is added to the database's list of backups.
  2. The backup you chose is loaded into a fresh copy of the database, next to the one your app is using.
  3. HCode checks the copy: that the database accepts connections, that the tables (for Redis, the keys) are there and, where the backup recorded them, that the row counts roughly match.
  4. The database switches over to the restored copy.

Your app keeps running throughout. At the switch the database restarts once and the connections your app has open are dropped. If your app doesn't reconnect by itself, restart it once the restore is done.

If the check in step 3 fails, nothing is switched and your current data is left as it was.

A Redis restore brings back database 0, the only one its backups cover. See Redis.

Going back after a restore

The dashboard has no undo for a restore. The Manage backups window says as much: "Restoring a backup will overwrite all current data. This cannot be undone."

The backup HCode took in step 1 is your way back. To return to the data you had before, restore that backup the same way. Anything your app wrote after the first restore is lost when you do.

When a restore is refused

  • "this target has no enabled backup policy, so no snapshot can be taken before the restore replaces it": the database has no active backup schedule to take the safety backup with. You also get it when you restore a backup from a deleted schedule and the database has no other schedule. Add a schedule and try again.
  • "a backup is already running for this policy": wait for the running backup to finish.
  • "This database is being set up or moved. Wait for that to finish, then try again."
  • "backups are not available on your current plan": your plan doesn't include backups. See the Subscription page.

Being over your storage or bandwidth allowance does not block a restore, because it only brings back data you already had.

Owners, admins and members can restore backups. See Roles and permissions.