Skip to content

Updates and backups

Update an app to a new version, back up and restore its database and uploads, and keep AUTH_SECRET safe.

View as MarkdownCoding agents can read this page at /docs/updates-backups.md

Each app keeps its data in two places: the Postgres database (almost everything) and the uploaded files (logos and profile photos, on a volume or in a bucket). Back up both, and keep a copy of AUTH_SECRET.

How updates work

There are no version numbers to manage yet: you deploy the latest code from the repository’s main branch. When the new version starts, it applies any pending database migrations (changes to the database structure) before it accepts traffic. You don’t run migration commands yourself.

Migrations only go forward. If you need to go back to an older version after a migration has run, restore the database backup you took before updating. So:

  1. Back up the database (see below).
  2. Update.
  3. Check /api/health and sign in.

Railway

If the service deploys from your fork, open the fork on GitHub and click Sync fork, then Update branch. Railway sees the change and redeploys. If you deployed from a Railway template, Railway offers template updates as a pull request on the repository it created for you; merge it to deploy.

Render

Sync your fork on GitHub the same way. Render redeploys the services linked to that branch.

Docker Compose

cd saas-clones
git pull
cd apps/scheduler          # or apps/invoicing
docker compose up -d --build
docker compose logs -f app # wait for "listening on :3000"

Back up the database

Use pg_dump, Postgres’s standard backup tool. The examples write a compressed custom-format file (-Fc) that pg_restore can read. Use a pg_dump at least as new as the Postgres server. The examples run it from the official postgres:17-alpine image; if your server runs a newer major version (check with SELECT version();), use that version’s image instead.

Docker Compose

cd saas-clones/apps/scheduler
docker compose exec -T db pg_dump -U scheduler -Fc scheduler > scheduler-$(date +%F).dump

For Invoicing, replace both scheduler names with invoicing.

Railway

  1. Open the Postgres service. In Settings > Networking, enable public access. This creates the DATABASE_PUBLIC_URL variable. Traffic through it is billed as egress, and anyone with the URL can try to connect, so turn it off again when you’re done if you don’t need it.

  2. Copy DATABASE_PUBLIC_URL from the Postgres service’s variables and run:

    docker run --rm postgres:17-alpine pg_dump -Fc "postgresql://..." > scheduler-$(date +%F).dump

Railway also offers scheduled backups for services with volumes, including its Postgres databases. Turning them on is a good extra safety net.

Render

Copy the database’s external connection URL from the database page in the Render Dashboard and run the same docker run ... pg_dump command. Check which backups your Render database plan includes as well.

What’s in the dump

Everything except uploaded files: users, settings, bookings or invoices, the email log, and the background job queue (stored in a pgboss schema in the same database).

Store dumps somewhere other than the server itself, and test a restore now and then.

Restore the database

Restore into an empty database, or into the existing one with --clean to replace what’s there. Stop the app first so nothing writes during the restore.

# Docker Compose
docker compose stop app
docker compose exec -T db pg_restore -U scheduler -d scheduler --clean --if-exists --no-owner < scheduler-2026-11-14.dump
docker compose start app
# Hosted database (Railway, Render, any other)
docker run --rm -i postgres:17-alpine pg_restore --clean --if-exists --no-owner -d "postgresql://..." < scheduler-2026-11-14.dump

The app must use the same AUTH_SECRET as when the backup was taken (see below).

Back up uploads

Docker Compose volume

The uploads are in the appdata volume (named scheduler_appdata or invoicing_appdata):

docker run --rm -v scheduler_appdata:/data -v "$PWD":/backup alpine \
  tar czf /backup/scheduler-uploads-$(date +%F).tgz -C /data .

To restore, stop the app and extract the archive back into the volume:

docker compose stop app
docker run --rm -v scheduler_appdata:/data -v "$PWD":/backup alpine \
  tar xzf /backup/scheduler-uploads-2026-11-14.tgz -C /data
docker compose start app

Railway volume

Use Railway’s backups for the volume attached to the app service.

Bucket

Copy the bucket with any S3 tool, for example the AWS CLI (add --endpoint-url for non-AWS providers):

aws s3 sync s3://my-app-uploads ./uploads-backup

Uploads are only logos and profile photos, so losing them is an inconvenience rather than a disaster. The database matters most.

Keep AUTH_SECRET

AUTH_SECRET isn’t stored in the database, so a database backup alone isn’t a full backup. The secret:

  • signs every sign-in session, so changing it signs everyone out;
  • signs the temporary links to uploaded files;
  • encrypts the calendar credentials users save in the Scheduler (CalDAV passwords and Google Calendar access). With a different secret, those can’t be decrypted, and every user has to remove and reconnect their calendars.

Store it in a password manager next to your backups, and set the same value when you restore or move to another host. Only replace it if it has leaked, and accept the effects above when you do.

Moving to another host

  1. Deploy the app on the new host with the same AUTH_SECRET, but don’t open /setup.
  2. Stop the old app, take a database backup, and restore it into the new database.
  3. Copy the uploads (or point the new app at the same bucket).
  4. Update APP_URL, DNS, and, if you use them, the Google redirect URIs and the Stripe webhook URL.
  5. Start the new app and check /api/health. /api/bootstrap should show "needsSetup":false.