Skip to content

Backups & moving servers ​

A Replora installation is the database, the recordings, the .env file and a few files in storage/. Back those up regularly and you can restore the site, or move it to another server, in a few minutes. Everything else can be downloaded again.

15 minutesDevOps, site ownersServer administrationSingle user · SaaS

What to back up ​

WhatWhereWhy
The databasePostgreSQLAccounts, websites, sessions, every report, settings changed in the dashboard, plans and subscriptions (SaaS)
.envApplication folderThe database password and APP_KEY: without the same key, saved secrets (SMTP password, API keys, payment keys) can't be read
Recordingsstorage/app/recordings (local driver) or your bucketThe recorded events: without them sessions are listed but can't be replayed
Private filesstorage/app/privateUploaded logo and favicon, ticket attachments, website page documents, payout proofs (the location databases in storage/app/geoip are downloaded again weekly)
License filestorage/app/replora-license.jsonThe verified purchase code; updates use it to fetch new modules
Installed markerstorage/app/replora-installed.jsonCloses the installer; without it a restored copy would open the installer again (it also holds the purchase code)
Your own modulesFolders you added to modules/ or saas/modules/They are not part of any package

You don't need to back up vendor/, public/build/, the Replora modules (re-download them with php artisan replora:core), storage/framework/, storage/logs/ or the update backups in storage/app/updates.

Simplest rule

Back up the database and the whole storage/ folder plus .env. That covers everything on the list except your own modules.

Back up the database ​

bash
pg_dump -Fc -h 127.0.0.1 -U replora replora > replora-$(date +%F).dump

-Fc writes PostgreSQL's compressed custom format, restored with pg_restore. The dump is consistent while the site keeps running. To avoid typing the password, put it in ~/.pgpass (127.0.0.1:5432:replora:replora:a-long-password, mode 600).

On shared hosting, use the control panel's backup (cPanel: Backup › Download a PostgreSQL Database Backup) or phpPgAdmin's export.

A nightly backup script ​

bash
#!/usr/bin/env bash
# /usr/local/bin/replora-backup: database, .env and storage/ (without caches, logs and update backups)
set -euo pipefail
APP=/var/www/replora
OUT=/var/backups/replora
mkdir -p "$OUT"
STAMP=$(date +%F)

pg_dump -Fc -h 127.0.0.1 -U replora replora > "$OUT/db-$STAMP.dump"
tar czf "$OUT/files-$STAMP.tgz" -C "$APP" .env \
  --exclude=storage/framework --exclude=storage/logs --exclude=storage/app/updates storage

# keep 14 days
find "$OUT" -type f -mtime +14 -delete
bash
sudo chmod +x /usr/local/bin/replora-backup
echo "30 2 * * * root /usr/local/bin/replora-backup" | sudo tee /etc/cron.d/replora-backup

It runs at 02:30, before recordings are pruned at 03:00. Copy /var/backups/replora to another machine or to object storage (rclone, restic, borg): a backup on the same disk doesn't survive a disk failure.

Recordings in a bucket ​

With RECORDINGS_DRIVER=s3 the recordings are not on the server. Turn on versioning (S3, MinIO) or make a regular copy into a second bucket (rclone sync r2:replora-recordings backup:replora-recordings). Recordings are deleted every night after their retention period, so a copy only needs to keep what is still within it.

Restore ​

  1. Put the application files in place: unpack the same version's package, or your file backup.
  2. Restore .env and storage/ from the backup into the application folder.
  3. Restore the database into an empty database:
bash
sudo -u postgres psql -c "CREATE DATABASE replora OWNER replora;"   # if it doesn't exist
pg_restore --clean --if-exists --no-owner -h 127.0.0.1 -U replora -d replora db-2026-11-20.dump
  1. Fix the owner and permissions, and fetch the modules if modules/ is incomplete:
bash
cd /var/www/replora
sudo chown -R www-data:www-data .
sudo -u www-data php artisan replora:core
sudo -u www-data php artisan config:clear
sudo -u www-data php artisan queue:restart
  1. Open Administration › System and click Check now: every service should work.

If the backup is from an older version than the files you restored, finish the update afterwards (Finish the update or php artisan replora:upgrade). Files older than the database refuse to run an update: restore files of the same version or newer.

Move to another server ​

Keep the same domain if you can: every website's snippet points at it, and the license is attached to it.

  1. Prepare the new server as in Install on a VPS: packages, PostgreSQL user and an empty database, Nginx. Don't run the installer.
  2. Copy the files: the whole application folder (or a fresh package of the same version plus .env, storage/ and your own modules).
  3. Copy the database: dump it on the old server and restore it on the new one, as above. Change DB_HOST, DB_DATABASE, DB_USERNAME, DB_PASSWORD in .env if they differ.
  4. Recordings: on the local driver they came with storage/; with a bucket nothing moves.
  5. Permissions, modules, caches: chown, replora:core, config:clear as in Restore.
  6. Background services: the Supervisor or systemd worker and the cron line on the new server.
  7. Switch DNS to the new server, then get the certificate there (certbot --nginx -d analytics.example.com).
  8. Catch up: the old server keeps receiving recordings until DNS has switched everywhere. For a clean cut, copy the recordings written in the meantime again (rsync -a old:/var/www/replora/storage/app/recordings/ /var/www/replora/storage/app/recordings/); sessions in the old database from those hours are lost unless you dump the database again at the very end.
  9. Check: php artisan replora:doctor and the System page; stop the worker and cron on the old server.

Moving to a new domain

  • The license is attached to the old domain: contact our support with your purchase code to move it, or updates stop with This purchase code is already used on ….
  • Change APP_URL and SANCTUM_STATEFUL_DOMAINS in .env, then php artisan config:clear.
  • Every website's snippet contains the old address (https://old.example.com/t.js): replace the snippets on all recorded websites. Replora answers only on the host of APP_URL (and its subdomains), so the old domain can't simply be added as an alias in Nginx; keep the old installation running until every snippet is replaced.

Replora: see what your visitors see.