Github|...

Backups

Sp00ky Cloud takes care of your backups for you. Make a snapshot whenever you want, set up a schedule, and roll back to any backup when you need to.

Quick Start

Bash
# Create a backup
spky cloud backup create

# List all backups
spky cloud backup list

# Restore from a backup
spky cloud backup restore <backup-id>

Creating Backups

Make a backup of your database whenever you want one.

Bash
# Create a backup
spky cloud backup create

# Create a named backup
spky cloud backup create --name before-migration

Backups run in the background. The CLI returns right away with a backup ID and a pending status. It moves to in_progress and then to completed once it’s done.

Listing Backups

Bash
spky cloud backup list

You’ll see something like this:

Bash
ID                                    STATUS        SIZE        CREATED
--------------------------------------------------------------------------------
before-migration (a1b2c3d4)           completed     12.4 MB     2026-04-08T10:00:00
e5f6a7b8-...                          completed     11.8 MB     2026-04-07T02:00:00
f9g0h1i2-...                          completed     10.2 MB     2026-04-06T02:00:00

Restoring from a Backup

Bash
spky cloud backup restore <backup-id>

Here’s what happens when you run it:

  1. The scheduler queues the restore and the CLI prints the restore ID.
  2. Ingestion stops. New writes get a 503, and proxy queries and SSP registrations are rejected while the restore is running.
  3. Both databases are wiped and reloaded from the same backup file. Main SurrealDB and the scheduler’s snapshot replica stay in sync.
  4. Pending items are cleared. That covers the in-memory event buffer, the write-ahead log, and any per-SSP message buffers.
  5. Connected SSPs are evicted. They’ll re-register on their next heartbeat against the restored state.
  6. The CLI polls for progress every 5 seconds (up to 5 minutes) and shows the current phase as it moves from queued to running to completed.
  7. Once the restore finishes, your migrations run again against the restored database.
Warning

Restoring replaces your current data with the backup. Anything you wrote after the backup was taken is gone. If you’re not sure, take a fresh backup first.

Note

If the main database gets wiped but the snapshot replica fails to import, the scheduler stays in the restoring state on purpose. That blocks reads until someone re-runs the restore. Serving traffic from a half-restored cluster would give back wrong data.

Deleting Backups

Bash
spky cloud backup delete <backup-id>

Automatic Backups

Set up a schedule with a cron expression:

Bash
# Enable daily backups at 2 AM, keep last 7
spky cloud backup configure --enabled true --schedule "0 2 * * *" --retention 7

# Disable automatic backups
spky cloud backup configure --enabled false

# Change retention to keep 30 backups
spky cloud backup configure --retention 30
OptionWhat it does
--enabledTurn automatic backups on or off (true/false)
--scheduleCron expression for how often to back up (e.g. "0 2 * * *" for daily at 2 AM)
--retentionHow many backups to keep before the oldest ones get deleted

Database Reset

Reset your database to a clean slate. This drops all data and re-runs your migrations.

Bash
spky cloud backup reset

The CLI will:

  1. Warn you that all data will be deleted.
  2. Ask you to confirm.
  3. Offer to create a backup first (a good idea).
  4. Wait for that backup to finish if you said yes.
  5. Reset the database and re-apply your migrations.

To skip the pre-reset backup prompt:

Bash
spky cloud backup reset --no-backup
Warning

There’s no undo for a reset. Every user, every record, every bit of app data goes away for good. Always take a backup first unless this is a dev project you don’t care about.

CLI Reference

Bash
spky cloud backup <COMMAND>

Commands:
  list                          List backups
  create [--name NAME]          Create a manual backup
  restore <backup-id>           Restore database from a backup
  delete <backup-id>            Delete a backup
  configure [--enabled] [--schedule] [--retention]
                                Configure automatic backups
  reset [--no-backup]           Reset the database (drop all data, re-run migrations)