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:

EngineBackupRestore
PostgreSQLpg_dumppg_restore, psql
MySQL / MariaDBmysqldump or mariadb-dumpmysql or mariadb

Where Mantidb looks

  • Homebrew, in /opt/homebrew/opt and /usr/local/opt (for example libpq, postgresql@N, mysql-client, mariadb, percona).
  • Postgres.app and /Library/PostgreSQL.
  • /usr/local/mysql/bin.
  • /opt/homebrew/bin, /usr/local/bin and /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_dump can'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

  1. Open Back Up for the connection.
  2. Choose the Database and, if needed, the Tool.
  3. Set the options below.
  4. Click Back Up… and choose where to save the file.
OptionDefaultDescription
FormatCustom (.dump)PostgreSQL only: Custom (.dump) or SQL (.sql). MySQL backups are always SQL.
ContentStructure and dataOr Structure only, or Data only.
Skip owners and privileges (restores under any role)OffPostgreSQL 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

  1. Open Restore for the connection.
  2. Choose the Database to restore into, and the Tool if needed.
  3. Click Choose… next to File and select a .dump, .sql or .tar file. Mantidb detects whether it is an archive or plain SQL.
  4. Set the options below.
  5. Click Restore and confirm.
OptionDefaultDescription
Drop existing objects before recreating themOffCustom archives only.
Skip owners and privilegesOffCustom archives only.
Stop at the first error and roll everything backOnPostgreSQL.
Stop at the first errorOnMySQL / 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 PGPASSWORD or 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_dump 17+ file into PostgreSQL older than 17 strips the SET transaction_timeout line.
  • Restoring a MariaDB 11 dump with the MySQL client strips the sandbox line.