
How to Test Backup and Restore Drills for a Small Database
Run a restore drill for a small database: schedule, steps, a clean machine, timing the recovery, checking data and writing down what to fix.
Dumps, restores, ad-hoc queries and safe data moves for MySQL, PostgreSQL and SQLite from the terminal.

Run a restore drill for a small database: schedule, steps, a clean machine, timing the recovery, checking data and writing down what to fix.

Prepare JSON for a database import with jq: flatten to CSV or JSON Lines, handle nulls and types, escape safely, and load with COPY, mongoimport or SQLite.

Move data between SQLite, MySQL and PostgreSQL from the shell: dumps and their dialect problems, CSV as the neutral format, type mapping, pgloader and checks.

Check database readiness with pg_isready and mysqladmin ping: exit codes, Docker healthchecks, scripts and monitoring, and what they do not test.

Use Docker for throwaway databases in scripts: random localhost port, readiness wait, fixtures, cleanup with a trap and tmpfs for speed.

Schedule database maintenance jobs safely: backups, vacuum and analyze, optimize, index checks, off-peak timing, locks, runtime limits and monitoring results.

Fix PostgreSQL role does not exist: createuser, psql defaults to your OS user, the missing database error, quoting case-sensitive names and idempotent setup.

Create database users and grants from the shell for PostgreSQL and MySQL: least privilege, passwords kept off the command line, idempotent scripts and checks.

Fix PostgreSQL peer authentication failed for user: pg_hba.conf rules, Unix socket versus TCP, matching OS and database user names, and a safe change.

Compare mysqldump, mydumper and Percona XtraBackup: logical versus physical backup, speed, consistency, locking, restore time and when to use each.

Why a backup you never restored is not a backup: the ways backups fail silently, and a short routine to restore, verify and monitor them.
One email when a new post is published. No spam.