Backups
A Tidal PTC backup has two parts: the PostgreSQL database, which holds every tenant, school, user, time slot and reservation, and the .env file, which holds APP_KEY. You need both. The tenant’s PowerSchool and SMTP credentials are encrypted in the database with APP_KEY, so a database restored without its key can’t connect to PowerSchool or send email.
Who this is for
Section titled “Who this is for”Anyone running a self-hosted install.
What to back up
Section titled “What to back up”| What | Where | Why |
|---|---|---|
| Database | The postgres Docker volume, or the tidal_ptc database on a VM |
All application data |
.env |
/opt/tidal-ptc/.env (Docker) or /var/www/tidal-ptc/.env (VM) |
APP_KEY, database password and Reverb credentials |
Keep the .env backup somewhere as safe as a password store: anyone with APP_KEY and a copy of the database can decrypt the tenant secrets.
You don’t need to back up the rest of the install directory. The code comes from the image or Git, and storage/ only holds logs and caches. Redis holds sessions, cache and queued jobs; losing it signs everyone out and drops any jobs still waiting, but loses no records.
Back up the database
Section titled “Back up the database”Docker, from /opt/tidal-ptc:
docker compose exec -T postgres sh -c 'pg_dump -U $POSTGRES_USER $POSTGRES_DB' | gzip > ptc-$(date +%F).sql.gzVM:
sudo -u postgres pg_dump tidal_ptc | gzip > ptc-$(date +%F).sql.gzEach command writes a compressed dump named after today’s date to the current directory. Copy it off the server. To run it nightly, add the command to a cron job on the host.
DigitalOcean: run pg_dump against the connection details of the app’s db database.
Restore a backup
Section titled “Restore a backup”Docker:
gunzip -c ptc-YYYY-MM-DD.sql.gz | docker compose exec -T postgres sh -c 'psql -U $POSTGRES_USER $POSTGRES_DB'VM:
gunzip -c ptc-YYYY-MM-DD.sql.gz | sudo -u postgres psql tidal_ptcRestore .env before you start the app, so APP_KEY matches the data.
Docker volumes
Section titled “Docker volumes”Data lives in the postgres and redis Docker volumes. docker compose down keeps them; docker compose down -v deletes them.