dumpsql
Dumpsql: The Definitive Guide
Key Takeaways
- Dumpsql is a lightweight, cross‑platform utility for exporting MySQL and MariaDB databases.
- It supports incremental dumps, compression, and encryption out of the box.
- Compared to
mysqldump, dumpsql offers faster performance on large datasets and easier configuration. - Use the best practices checklist to ensure reliable backups.
- Common questions are answered in the FAQ section at the end.
What is Dumpsql?
Dumpsql is an open‑source command‑line tool designed to create full or partial database dumps in a format that can be restored by mysql or mysqlimport. It focuses on speed, reliability, and flexibility, making it ideal for production environments, CI/CD pipelines, and automated backup scripts.
Why Use Dumpsql?
- Fast execution even on tables with millions of rows.
- Supports
--incrementalmode for incremental backups. - Built‑in gzip and AES encryption for secure storage.
- Simple configuration via a YAML file or command‑line flags.
- Cross‑platform: works on Linux, macOS, Windows.
Key Features
- Incremental Backups – Only changes since the last dump are captured.
- Compression & Encryption –
--compress gzipand--encrypt aes256options. - Support for
--tables,--ignore-tables, and--whereclauses. - Automatic retry logic for transient network failures.
- JSON and YAML output for integration with monitoring tools.
Installation & Setup
- Download the latest release from GitHub.
- Extract the archive and move
dumpsqlto/usr/local/bin(Linux/macOS) or add it toPATH(Windows). - Create a configuration file
~/.dumpsql.yaml(optional) with default settings. - Verify installation:
dumpsql --version.
How to Dump a Database with Dumpsql
- Open a terminal and run:
dumpsql --user=root --password=secret --host=localhost --database=mydb --output=/backups/mydb.sql.gz --compress gzip - For an incremental dump:
dumpsql --incremental --output=/backups/mydb_inc_$(date +%F).sql.gz - To dump specific tables:
dumpsql --tables=users,orders --output=users_orders.sql.gz - Verify the dump by restoring it to a test environment:
mysql -u root -p testdb < users_orders.sql.gz
Advanced Options
--threads N– Parallelize dumps across N threads.--skip-constraints– Disable foreign key checks during restore.--exclude-columns="password,ssn"– Omit sensitive columns.--log-level=debug– Verbose logging for troubleshooting.- Environment variables:
DUMPSQL_HOST,DUMPSQL_USER, etc.
Comparison with Other SQL Dump Tools
| Feature | Dumpsql | mysqldump | pg_dump |
|---|---|---|---|
| Speed | ✓ Fast (parallel threads) | ✗ Slower on large tables | ✓ Good for PostgreSQL |
| Incremental Backups | ✓ Yes | ✗ No native support | ✗ No native support |
| Compression | ✓ Built‑in gzip/zip | ✓ External gzip | ✓ External gzip |
| Encryption | ✓ AES‑256 | ✗ No encryption | ✗ No encryption |
| Cross‑platform | ✓ Linux/macOS/Windows | ✓ Linux/macOS | ✓ Linux/macOS |
| Configuration | ✓ YAML + CLI flags | ✓ CLI flags only | ✓ CLI flags only |
| Community & Support | ✓ Growing community | ✓ Mature, widely used | ✓ Mature, widely used |