Backups and restore

Cloudgate writes database dumps and volume tarballs off the machine to any S3-compatible bucket you add as a Destination, on a cron. In a Cloud account the cloud keeps its own backups instead.

Applies to: Owner or Admin for DestinationsMembers can back up and restore

The examples back up the PostgreSQL database pg-main and the uploads volume of the web Application in storefront to a Destination named Nightly backups.

What you can do

  • Add S3-compatible buckets as Destinations for the whole Organization.
  • Schedule database dumps, keep the newest few, run one now, and restore one.
  • Schedule volume backups of an Application’s or a bucket’s volumes, and restore a tarball.
  • Set how long AWS or Google Cloud keeps a cloud database’s automated backups.

Add a Destination

  1. Open Destinations

    Open Settings > Destinations and press Add a destination.

    cloudgate.octabyte.app/settings/destinations
    Destinations are shared by every Project in the Organization.
  2. Describe the bucket

    Fill in Name (only you see it), Endpoint (with its scheme), Region (empty if your provider has none), Bucket, Provider, Access key and Secret access key. The secret is stored encrypted and never shown again.

  3. Test and save

    Press Test connection, then save. Cloudgate reaches the bucket with rclone, so anything S3-compatible works.

Schedule database dumps

  1. Open the Backups tab

    Open the database, such as pg-main, and its Backups tab.

  2. Add a schedule

    Under Scheduled dumps press Add a schedule and set:

    • Database: the database inside this engine to dump.
    • Destination: where the dumps are written.
    • Prefix: the path in the bucket.
    • Cron expression: five fields, such as 0 2 * * * for every day at 02:00.
    • Keep the newest: older dumps under the prefix are deleted after each successful run. Empty keeps every one.
    • Run on the cron: off keeps the schedule without firing it.
    cloudgate.octabyte.app/databases/postgres/…/backups
    The list below the schedules is read straight from the bucket.
  3. Run it once

    Press Run now on the row. Pause and Resume stop and restart the cron. Every run is listed on the Environment’s Deployments tab as a database backup with its log.

Engines dump differently: MySQL dumps run as root, and a libSQL backup is a tar of its data directory. Redis has no dump, so its Backups tab says Cloudgate cannot back it up.

Restore a database dump

  1. Find the dump

    On the Backups tab, under Dumps in the destination, choose the Destination and press Restore on the file.

  2. Name the database

    The dialog’s steps are Choose the dump, Name the database and Replace its contents. Name the database inside the engine that the dump goes into.

  3. Confirm

    Type the database’s name to confirm and restore.

Back up a volume

Volume backups copy a named Docker volume off its Server as a tarball.

  1. Open Volume backups

    Open the Application, such as web, and its Volume backups tab. For a bucket on a Server, use the volume backups on the bucket’s own screen.

  2. Add a backup

    Press Add a backup and set Name, Volume, Destination, Prefix, Cron expression and Keep the newest.

  3. Decide whether to stop the Service

    Tick Stop the service while the backup runs for a volume that is written to all the time, such as a database’s. A volume tarred while being written can produce a tarball that will not restore; stopping costs downtime and is the only way to be certain.

  4. Run it now

    Press Run now on the row to check it. The outcome lands in the run history below.

Restore a volume

  1. Stop what uses the volume

    A volume cannot be restored while any container, running or exited, references it. Stop the Application; for a Docker Compose stack, use Remove containers.

  2. Start the restore

    On the Volume backups tab, press Restore a volume under Restore, or Restore on a backup row.

  3. Choose and confirm

    Go through Choose the tarball, Confirm the volume and Replace its contents. The tarball is unpacked over the volume on the Server.

  4. Start it again

    Start the Application, or the stack.

Backups of databases in AWS and Google Cloud

A database in a Cloud account has no dump schedules: “Dump backups to a Destination are Server-only for now.” Its Backups tab shows what the cloud keeps, read live: the retention and, where the cloud reports one, the earliest and latest restorable time.

Database Card Range
RDS (PostgreSQL, MySQL) Backup retention, in days 1 to 35; it cannot be turned off here
ElastiCache (Redis) Snapshot retention, in days 0 to 35; 0 turns snapshots off
Cloud SQL (PostgreSQL, MySQL) Backup retention, daily backups kept 1 to 365; point-in-time recovery is on beside them
Memorystore (Redis) Backup retention, in days 0 to 365; 0 turns backups off

To restore, use the cloud’s own console, linked from the tab. A restore there makes a new instance. Deleting a cloud database takes a final snapshot unless you ask to delete its data too.

Who can do what

Action Who
Add, test, delete a Destination Owner or admin
Schedule, run, pause and restore dumps and volume backups Members granted the Service, owners and admins

Two backups or restores of the same volume never run at once: the second is refused with a 409 naming the busy volume, and a scheduled backup waits its turn.

What you cannot do

  • Dump Redis, or schedule dumps for a database in a Cloud account.
  • Restore a cloud database from the Cloudgate console.
  • Restore a volume while a container still references it.
  • Schedule volume backups from a Compose stack’s own screen: the Volume backups tab is on Applications and on buckets.
  • Count on a Deployment to back anything up.

Questions

Where can Cloudgate store backups?

In any S3-compatible bucket: AWS S3, MinIO or another provider. Cloudgate reaches it with rclone. Add it once as a Destination for the whole Organization.

Can I back up Redis?

Not with a dump: Redis has no dump or restore command in Cloudgate. In ElastiCache or Memorystore the cloud keeps its own snapshots or backups.

How do I restore a database in AWS or Google Cloud?

In the cloud console. The Backups tab shows the retention and restore window, with a link; a restore there makes a new instance, so the console has no Restore button.

Does a Deployment back up my volumes?

No. A Deployment leaves a volume where it is. Only a volume backup copies it off its Server.

Something missing or wrong on this page? Email support@octabyte.io, or start a free trial and try it in the console.