Backup & Restore
Back up and restore PostgreSQL and MySQL databases with the client tools installed on your Mac.
Mantidb backs up and restores databases by running the official command-line tools — pg_dump, mysqldump and friends — with your connection's settings. You choose the options; Mantidb finds the right tool, passes your credentials safely and shows the tool's output live.
Supported engines
Backup and restore are available for:
- PostgreSQL (and engines you connect to with the PostgreSQL driver).
- MySQL / MariaDB.
SQLite and SQL Server databases can't be backed up or restored from Mantidb.
Open backup or restore
- In a workspace window, choose File ▸ Back Up Database… or File ▸ Restore Database….
- In the welcome window, click Backup Database or Restore Database and pick a saved PostgreSQL or MySQL connection. Mantidb connects and opens the sheet.
Required client tools
Mantidb doesn't bundle any database tools. It uses the ones installed on your Mac:
| Engine | Backup | Restore |
|---|---|---|
| PostgreSQL | pg_dump | pg_restore, psql |
| MySQL / MariaDB | mysqldump or mariadb-dump | mysql or mariadb |
Where Mantidb looks
- Homebrew, in
/opt/homebrew/optand/usr/local/opt(for examplelibpq,postgresql@N,mysql-client,mariadb,percona). - Postgres.app and
/Library/PostgreSQL. /usr/local/mysql/bin./opt/homebrew/bin,/usr/local/binand/usr/bin.- Your
PATH.
You can't set a tool path by hand. Install the tools in one of these places.
Installing the tools
If no suitable tool is found, Mantidb shows an install hint:
- PostgreSQL:
brew install libpq - MySQL:
brew install mysql-client - MariaDB:
brew install mariadb
Tool version
When several versions are installed, Mantidb picks one that matches the server:
- pg_dump — the same major version as the server or newer, preferring the same series.
pg_dumpcan't back up a server newer than itself. - pg_restore and psql — the newest installed.
- MySQL tools — the same flavor as the server (MySQL or MariaDB), at or above the server's version.
The Tool picker in the sheet shows the choice, for example pg_dump 18.4 · /opt/homebrew/opt/libpq/bin, and lets you pick another installed version.
Back up a database
- Open Back Up for the connection.
- Choose the Database and, if needed, the Tool.
- Set the options below.
- Click Back Up… and choose where to save the file.
| Option | Default | Description |
|---|---|---|
| Format | Custom (.dump) | PostgreSQL only: Custom (.dump) or SQL (.sql). MySQL backups are always SQL. |
| Content | Structure and data | Or Structure only, or Data only. |
| Skip owners and privileges (restores under any role) | Off | PostgreSQL only. |
You back up a whole database. Choosing individual schemas or tables isn't supported.
File naming
The file name defaults to <database>-yyyy-MM-dd-HHmm.dump (or .sql). Mantidb writes to a .partial file first and renames it only when the backup succeeds. When it's done you see "Backed up <db> to <file> (<size>)" and a Show in Finder button.
MySQL dumps use --single-transaction --routines --triggers --hex-blob --no-tablespaces, plus --set-gtid-purged=OFF on MySQL.
Restore a database
- Open Restore for the connection.
- Choose the Database to restore into, and the Tool if needed.
- Click Choose… next to File and select a
.dump,.sqlor.tarfile. Mantidb detects whether it is an archive or plain SQL. - Set the options below.
- Click Restore and confirm.
| Option | Default | Description |
|---|---|---|
| Drop existing objects before recreating them | Off | Custom archives only. |
| Skip owners and privileges | Off | Custom archives only. |
| Stop at the first error and roll everything back | On | PostgreSQL. |
| Stop at the first error | On | MySQL / MariaDB. |
Progress and logs
While a backup or restore runs, the sheet shows a live log of the tool's verbose output (the last 500 lines). Click Stop to cancel.
Passwords, TLS and SSH
- Passwords are passed through
PGPASSWORDor a temporary MySQL option file readable only by you. They never appear in the command's arguments. - TLS settings follow the connection's TLS configuration.
- SSH connections open a fresh tunnel for the tool, including any jump hosts.
Safety
Restoring overwrites data, so it is always guarded, whatever the connection's safe mode:
- It is blocked on Read only connections.
- It always asks for confirmation ("Restore into <db> on <conn>?"), showing the exact command without secrets.
- It also asks for Touch ID on production connections or in Confirm + Touch ID for writes mode.
Compatibility notes
Mantidb smooths over two common version mismatches:
- Restoring a
pg_dump17+ file into PostgreSQL older than 17 strips theSET transaction_timeoutline. - Restoring a MariaDB 11 dump with the MySQL client strips the sandbox line.
