Backups

In Gadwal 1.0 you back up by hand, to a folder on your Mac or a folder in iCloud Drive. Every engine except BigQuery.

Make a backup

  1. Select a connection and choose Connection › Backups… (or right-click the connection, or click Backups in the toolbar of its window), then click Back Up Now.
  2. The first time, pick a destination folder (you can change it later in Settings › Backups). Any folder works, including one in iCloud Drive (Apple then syncs it). Gadwal remembers the folder.
  3. Watch the progress, or click Cancel to stop. When it finishes, the backup appears in the connection’s backup history with its size and time.
The Backups sheet for the Sample Store, saved to iCloud Drive, listing one backup of 4 tables and 804 rows, with Back Up Now.
The Backups sheet: history for this connection, saved to iCloud Drive.

Back Up Now and Restore need an active trial or the lifetime unlock.

Before backing up a very large table (common on ClickHouse), Gadwal shows an estimate of the row count and warns you above 1,000,000 rows, so you can stop if it would take too long.

What a backup contains

Each backup is one folder. Inside it is a compressed SQL file for each table, plus a manifest.json listing the engine, server version, tables, row counts, file sizes, a SHA-256 checksum for each file, and the Gadwal version.

EngineFiles
PostgreSQLOne .sql.gz per table: structure, then rows as INSERT statements
MySQL, MariaDB, WordPressOne .sql.gz per table: structure, then rows as INSERT statements
Cloudflare D1One .sql.gz per table, read through the Cloudflare API
ClickHouseOne .sql.gz per table. Gadwal shows a row-count estimate first
SQLiteOne .sql.gz per table: structure, then rows as INSERT statements
DuckDBOne .sql.gz per table

The .sql.gz files are plain SQL once unzipped, so you can read them in any text editor or run them with your engine’s own command-line tool.

Backup history

Each connection keeps a list of its backups. From the list you can Show in Finder, Restore…, or Delete… a backup (Delete moves its folder to the Trash).

Restore

  1. Pick a backup from the connection’s history and choose Restore….
  2. Choose the tables to restore.
  3. Gadwal backs up those tables as they are now, so you can undo the restore.
  4. It replays the backup, inside a transaction where the engine supports one, and shows a summary of what was restored.
Restoring a backup of the Sample Store from iCloud Drive: two of four tables are ticked, with their row counts, and a Restore 2 Tables button.
Restore asks which tables to bring back and backs them up first.

On a connection tagged Production, you type the connection’s name to confirm before anything is changed.

BigQuery

Gadwal 1.0 doesn’t make BigQuery backups. BigQuery keeps 7 days of history for every table (time travel), so you can query or restore a table as it was at an earlier time. Backups for BigQuery are planned for a later version.

Automatic backups before risky changes

Before a destructive statement from an AI app runs (DROP, TRUNCATE, DELETE without WHERE and similar), and before WordPress search and replace, Gadwal backs up the affected tables as SQL (BigQuery uses its 7-day time travel instead). These backups are always on. Each one is listed with the change that caused it, and you can open the backup file from the AI activity log.

Coming later

Not in 1.0, planned for 1.0.1: scheduled backups, and pushing backups to Amazon S3 and Cloudflare R2.