Backup & restore

Tether's data lives in one database. Backing up is straightforward and should happen automatically every day. This page covers backup and restore for all supported databases.

A backup on the same server as your database is not a real backup

If your server dies, catches fire, or gets ransomwared, you lose both the database and the backup. Store backups somewhere else — S3, Backblaze B2, a different VPS, or your workstation.

MariaDB — Docker

Backup

bash
# While Tether is running, dump the database to a file docker exec tether-db \ mysqldump -u tether -ptether tether \ > backup-$(date +%Y%m%d-%H%M).sql # Verify the backup file has content wc -l backup-$(date +%Y%m%d-%H%M).sql # Should show hundreds or thousands of lines, not 0

Restore

bash
# Stop the app to prevent writes during restore docker compose stop app # Restore the dump docker exec -i tether-db \ mysql -u tether -ptether tether \ < backup-20260531-0200.sql # Start the app again docker compose start app
The -p flag and password have no space between them

-ptether (no space) is correct MariaDB/MySQL syntax. -p tether (with a space) would treat "tether" as a database name and prompt for a password interactively.

MariaDB — bare-metal

bash
# Backup mysqldump -u tether -p tether > backup-$(date +%Y%m%d).sql # Enter your database password when prompted # Restore sudo systemctl stop tether mysql -u tether -p tether < backup-20260531.sql sudo systemctl start tether

PostgreSQL

bash
# Backup (pg_dump creates a portable format) pg_dump -U tether -Fc tether > backup-$(date +%Y%m%d).dump # Restore sudo systemctl stop tether pg_restore -U tether -d tether -c backup-20260531.dump sudo systemctl start tether

SQLite

bash
# SQLite is a single file — stop Tether before copying to avoid a partial read sudo systemctl stop tether # bare-metal docker compose stop app # Docker # Backup cp data/tether.db backups/tether-$(date +%Y%m%d).db # Restart sudo systemctl start tether docker compose start app # Restore sudo systemctl stop tether cp backups/tether-20260531.db data/tether.db sudo systemctl start tether

Automated daily backups

Add a cron job to back up automatically. Example for MariaDB with Docker:

bash
crontab -e # Add these lines: # Daily backup at 2:00 AM 0 2 * * * docker exec tether-db mysqldump -u tether -ptether tether > /var/backups/tether/tether-$(date +%Y%m%d).sql # Delete backups older than 30 days 0 3 * * * find /var/backups/tether -name "*.sql" -mtime +30 -delete # Create the backup directory first: mkdir -p /var/backups/tether

Offsite backup example (Backblaze B2)

bash
# Install rclone curl https://rclone.org/install.sh | sudo bash # Configure rclone with your B2 account rclone config # Add to crontab — sync backups to B2 after creating them 30 2 * * * rclone sync /var/backups/tether b2:your-bucket-name/tether-backups

Verifying backups

A backup you haven't tested is not a backup — it's a hope. Monthly, restore your latest backup to a test environment and verify:

Last updated: May 2026