Interactive backup and restore CLI for PostgreSQL, MariaDB, and MSSQL.
Project description
fuelrod-backup
Interactive backup and restore CLI for PostgreSQL, MariaDB/MySQL, and Microsoft SQL Server.
Features
- Supports
postgres,mariadb, andmssqlengines - Interactive backup and restore wizards with progress bars
- Non-interactive backup mode for automation
- Docker and direct-host connection modes
- Config bootstrap wizard (
init) and connection check (test) - Backup retention cleanup (
KEEP_DAYS) - Interactive database and schema drop (
drop) - n8n Docker volume snapshots with no container downtime
- Google Drive sync via rclone (
gdrive-sync) - MariaDB → PostgreSQL migration with schema transformation, data migration, and post-migration validation (
migrate)
Installation
pip install fuelrod-backup
Or with pipx:
pipx install fuelrod-backup
Quick Start
- Initialize config:
fuelrod-backup init
- Validate connection:
fuelrod-backup test
- Run backup:
fuelrod-backup backup
- Run restore:
fuelrod-backup restore
Documentation
- Configuration Reference
- Architecture and Workflows
- Migration Guide
- Feature Plan
- Feature Checklist
- Example config:
.backup.example
CLI Commands
fuelrod-backup init [OPTIONS]
fuelrod-backup test [OPTIONS]
fuelrod-backup backup [OPTIONS]
fuelrod-backup restore [OPTIONS]
fuelrod-backup drop [OPTIONS]
fuelrod-backup migrate [OPTIONS]
fuelrod-backup n8n-backup [OPTIONS]
fuelrod-backup n8n-restore [OPTIONS]
fuelrod-backup gdrive-sync [OPTIONS]
The short alias fr-bkp is equivalent to fuelrod-backup for all commands.
init
Wizard to generate a .backup config file.
--output, -o PATH— output path (default:.backup)
test
Validate connection and print the resolved config.
--docker / --no-docker--db-type, -t—postgres | mariadb | mssql--config, -c PATH
backup
Interactive or non-interactive backup with optional retention cleanup.
--no-interactive, -n— skip prompts and back up all databases--all-engines, -a— back up all engines in parallel (multi-engine config)--compress / --no-compress— overrideCOMPRESS_FILE--keep-days, -k INT— overrideKEEP_DAYS(0keeps forever)--db, -d TEXT— repeatable; restrict to specific database(s)--docker / --no-docker--db-type, -t--config, -c PATH
restore
Interactive restore with engine-specific options. PostgreSQL includes TOC analysis for schema, table, and role filtering.
--all-engines, -a— restore all engines sequentially (multi-engine config)--docker / --no-docker--db-type, -t--config, -c PATH
drop
Interactive database or schema drop. Terminates active connections before dropping and requires confirmation.
--docker / --no-docker--db-type, -t--config, -c PATH
migrate
Migrate a MariaDB database to PostgreSQL. Extracts schema from information_schema, transforms DDL, migrates data in batches, and validates row counts.
--source-db, -s TEXT— source MariaDB database--target-db, -t TEXT— target PostgreSQL database--target-schema TEXT— PostgreSQL schema (default:public)--batch-size, -b INT— rows per INSERT batch (default:1000)--parallel, -p INT— table-level parallelism (default:4)--dry-run— plan only, no writes--no-interactive, -n— skip wizard--validate / --no-validate— row-count reconciliation after migration (default: on)--validate-checksums— also compare MD5 checksums (slower)--fail-fast— stop on first table failure--unsigned-checks / --no-unsigned-checks— generateCHECK (col >= 0)forUNSIGNEDcolumns--enum-as-type / --enum-as-check— mapENUMtoCREATE TYPEinstead ofTEXT + CHECK--skip-table TEXT— repeatable; exclude table(s)--only-table TEXT— repeatable; migrate only these table(s)--report, -r PATH— write JSON migration report to file--config, -c PATH
n8n-backup
Hot snapshot of n8n Docker volumes as .tar.gz archives. No container downtime required.
--no-interactive, -n— back up all services--service, -s TEXT— repeatable; restrict to specific service(s)--config, -c PATH
n8n-restore
Restore an n8n volume from a .tar.gz archive.
--service, -s TEXT— service name--file, -f PATH— path to backup archive--dry-run— show plan without making changes--verbose, -v— print detailed step logs--config, -c PATH
gdrive-sync
Upload backup files to Google Drive via rclone, with optional age-based remote pruning.
--dry-run, -d— show plan without uploading--gdrive, -g TEXT— Google Drive remote folder name--days, -n INT— prune remote files older than N days--include, -i GLOB— repeatable; glob pattern to include--keep-local— skip local file deletion after upload--config, -c PATH
Config
Config is loaded in this order:
- Internal defaults
- Config file (
--configif passed, otherwise auto-discovered) - Environment variables (highest priority)
Auto-discovery order
For each directory below, files are checked in this order: .backup, .env, .env-backup
Directories searched:
- current working directory
- project directory
- parent repo directory
Required keys
DB_TYPE=postgres|mariadb|mssql
DB_USERNAME=
DB_PASSWORD=
DB_HOST=
DB_PORT=
Optional keys
| Key | Description |
|---|---|
USE_DOCKER |
true/false — connect via Docker exec |
SERVICE |
container name (Docker mode) |
BASE_DIR |
backup root directory |
COMPRESS_FILE |
true/false — gzip output |
KEEP_DAYS |
retention days (0 = keep forever) |
CONNECTION_TIMEOUT |
connection timeout in seconds |
Engine-specific keys
PostgreSQL:
| Key | Default | Description |
|---|---|---|
PG_DUMP_CMD |
pg_dump |
pg_dump executable |
PG_RESTORE_CMD |
pg_restore |
pg_restore executable |
PG_CMD |
psql |
psql executable |
MariaDB/MySQL:
| Key | Default | Description |
|---|---|---|
MYSQL_DUMP_CMD |
mariadb-dump |
dump executable |
MYSQL_CMD |
mysql |
client executable |
MSSQL:
| Key | Default | Description |
|---|---|---|
MSSQL_BACKUP_DIR |
— | backup directory path inside container |
Output layout
<BASE_DIR>/
postgres/<database>/<YYYYMMDD-HHMMSS>.dump[.gz]
mariadb/<database>/<YYYYMMDD-HHMMSS>.sql[.gz]
mssql/<database>/<YYYYMMDD-HHMMSS>.bak
Notes
- PostgreSQL backups use custom format (
.dump). Compression wraps the dump in.gz. - MariaDB backups use
.sql. Restore accepts.sql,.sql.gz, and.zip. - MSSQL backups use native
.bakformat (no gzip). - Config files generated by
initare written with0o600permissions.
License
GNU General Public License v3.0 or later. See LICENSE.
Breaking Change
Connection variables are now engine-agnostic only:
DB_USERNAMEDB_PASSWORDDB_HOSTDB_PORT
Legacy connection keys (PG_USERNAME, PG_PASSWORD, PG_HOST, PG_PORT) are no longer loaded.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fuelrod_backup-4.0.0.tar.gz.
File metadata
- Download URL: fuelrod_backup-4.0.0.tar.gz
- Upload date:
- Size: 79.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.0 CPython/3.14.4 Linux/6.17.0-1010-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d517a2ac5d53ef334c56f76d1854e8f66a7c99c0d9105fa8362debed3b6ea076
|
|
| MD5 |
ffdbc264b651b5309f3680f1a9988c48
|
|
| BLAKE2b-256 |
7e08d5519a726163da4b6b02b9a9fc3bacac858fc1c7159b416581be34159e9b
|
File details
Details for the file fuelrod_backup-4.0.0-py3-none-any.whl.
File metadata
- Download URL: fuelrod_backup-4.0.0-py3-none-any.whl
- Upload date:
- Size: 94.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.0 CPython/3.14.4 Linux/6.17.0-1010-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f856aadfef752380cba9ee84a26b47f5a2f3d79fd1d6f9677ed8fe4e114130c
|
|
| MD5 |
1c1abee2115019513f0316c1cd3367b8
|
|
| BLAKE2b-256 |
f3234fad7ce314a9b223a6feb3b717e85106cc21ca00619d69b355baf0530352
|