SuiviroSuiviro
Help Centre

Disaster recovery

Restore Drill

This guide walks you through the simplest way to prove your Suiviro backup actually works. You will export a backup from Lovable Cloud, restore it on your own computer using Postgres.app, and then compare the restored data against your live Suiviro account.

What this is and why we do it

A restore drill is a practice run. It answers one question: "If Suiviro disappeared overnight, could I get my data back from the backup?" Backups that have never been restored are just wishful thinking, so once a quarter we do a drill, save the report, and tick the compliance box.

The drill does not touch your live Suiviro data. It restores the backup into a separate, temporary database on your own Mac, then counts rows to make sure everything made it across.

Before you start

  • A Mac computer.
  • Postgres.app installed and opened at least once so it can finish setting itself up.
  • The suiviro_*.backup file you downloaded from Lovable Cloud (usually in your Downloads folder).
  • About 15 minutes of uninterrupted time.

Step 1 — Export the backup from Lovable Cloud

  1. Open Suiviro in your browser.
  2. Click Cloud in the left-hand menu.
  3. Click Advanced settings.
  4. Click Export project data.
  5. Wait for the email or notification that says the export is ready, then download the file. It will be a .backup file (for example, suiviro_260708.backup).
  6. Leave the file in your Downloads folder. Do not try to open it — MacOS does not know what to do with it.

Step 2 — Capture the production baseline

  1. In Suiviro, go to Settings → Admin → Restore Drill (the URL is /admin/restore-drill).
  2. Click Read baseline. Suiviro records the current number of businesses, clients, jobs, scheduled reminders and admin notes in your live account. It also records one "anchor" business ID.
  3. Click Select backup file and choose the .backup file you just downloaded.
  4. Tick the box that says you understand the backup is older than right now, so recent changes are not inside it.
  5. Click Start drill run.

After you start the run, the page shows you two things: a restore command and a verification SQL query. Leave that browser tab open — you will need both in a moment.

Step 3 — Open Postgres.app and create a test database

  1. Open Postgres.app from your Applications folder.
  2. If a small elephant icon appears in your menu bar at the top of the screen, click it and make sure it says the server is Running. If it says Start, click Start.
  3. Open Terminal on your Mac (press Command + Space, type "Terminal", press Enter).
  4. Type the following command exactly and press Enter:
    /Applications/Postgres.app/Contents/Versions/latest/bin/createdb suiviro_drill
  5. If nothing happens and you just get a new prompt, that means it worked.

Step 4 — Restore the backup into the test database

  1. In Terminal, type this to move into your Downloads folder:
    cd /Users/$USER/Downloads
  2. Now run the restore command. Replace suiviro_260708.backup with the exact name of your file:
    /Applications/Postgres.app/Contents/Versions/latest/bin/pg_restore --no-owner --no-privileges --schema=public --clean --if-exists --dbname=suiviro_drill suiviro_260708.backup
  3. Press Enter. You may see warnings or errors about an extension called pg_cron. That is normal — it is a cloud-only feature and does not matter for your data. If the command finishes and you can press Enter again, the restore probably worked.

Step 5 — Verify the restored data

  1. Back in the Suiviro Restore Drill page, find the box labelled Verification SQL.
  2. Click Copy SQL.
  3. Open Terminal again and run:
    /Applications/Postgres.app/Contents/Versions/latest/bin/psql --dbname=suiviro_drill
  4. You should see a prompt that looks like suiviro_drill=#.
  5. Paste the SQL you copied (right-click in Terminal and choose Paste, or Command + V), then press Enter.
  6. You will see one row of numbers and a true or false for anchor_found. Copy that whole row.
  7. Type \q and press Enter to leave psql.
  8. Paste each number into the matching box on the Restore Drill page, choose yes or no for anchor_found, then click Compare & save report.

The page will show you a side-by-side table. If the numbers match (or are close because the backup is a few hours old), the drill passes. You can copy the markdown report and save it somewhere safe for compliance records.

If something goes wrong

"pg_restore: command not found"

You typed the command without the full Postgres.app path. Use the full path that starts with /Applications/Postgres.app/Contents/Versions/latest/bin/.

"database suiviro_drill does not exist"

Run the createdb command from Step 3 again.

"pg_cron is not available" or lots of red errors

This is expected. The backup includes some cloud-only settings. As long as the public-schema tables restore and the verification row returns numbers, the drill is valid. If the restore stops completely, add --exit-on-error is not in your command; the command shown above does not include it, so warnings will not stop the restore.

The counts do not match at all

Check that you restored the file you selected in the drill, and that you pasted the verification SQL into suiviro_drill, not some other database. If you are unsure, delete the test database with /Applications/Postgres.app/Contents/Versions/latest/bin/dropdb suiviro_drill and start again from Step 3.


Still stuck? Email admin@suiviro.com with a screenshot of the error and a real person will reply, usually the same day in Australian business hours.