We offer customization solutions and support ([email protected]) | Visit us on bitbyte3 for complete VOD solutions with apps.
NixStream
Operations

Backup & Restore

Backup scripts and data recovery

Back up your video library, database, and config regularly. Do this before upgrades and after big uploads.

Automated backup

cd nixstream/nixstream
./scripts/backup.sh

The backup script captures database dumps and relevant application data. Schedule it via cron for regular backups:

0 2 * * * cd /path/to/core && ./scripts/backup.sh >> /var/log/nixstream-backup.log 2>&1

Run at least daily for active installs. Store backups off-server (S3, another machine, or backup service).

What to back up

ComponentLocationPriority
DatabaseMySQL dumpCritical
Encoded mediastorage/app/public/videos/Critical
Uploads in progressstorage/app/High
Configuration.envCritical (store encrypted, separately)
Whisper modelsbin/whisper/models/ or Docker imageMedium (re-downloadable)

Database dump manually

docker compose exec db mysqldump -u nixstream_user -p nixstream > backup.sql

Manual install:

mysqldump -u nixstream_user -p nixstream > backup.sql

Storage archive

tar -czf storage-backup.tar.gz storage/app/public/videos/

For S3-backed storage, use provider-native backup (versioning, cross-region replication) in addition to database backups.

Docker volumes

Docker Compose uses named volumes for db and storage:

docker volume ls | grep nixstream
docker volume inspect nixstream_storage_data

Volume data survives container restarts but not docker volume rm. Include volumes in your backup strategy or use bind mounts to host paths for easier file-level backup.

Restore procedure

  1. Stop services: ./install.sh --down
  2. Restore database dump to MySQL
  3. Restore storage/ files to the correct path
  4. Restore .env (or verify settings match the backup era)
  5. Start services: ./install.sh
  6. Run migrations if upgrading: php artisan migrate --force
  7. Verify a sample video plays and API responds

Restore database (Docker)

docker compose up -d db
docker compose exec -T db mysql -u nixstream_user -p nixstream < backup.sql

Restore storage

tar -xzf storage-backup.tar.gz -C /path/to/nixstream/nixstream/
chown -R www-data:www-data storage/

Migrations

Run database migrations after upgrades:

cd nixstream/nixstream
./scripts/migrate.sh
# or
docker compose exec app php artisan migrate --force

Always back up before migrating production databases.

Testing restores

Test restores quarterly on a staging server:

  1. Restore latest backup to a clean machine
  2. Confirm admin login works
  3. Play a random video
  4. Check API key authentication

Untested backups are a gamble.

Reset (destructive)

./install.sh --reset

Deletes all database data and Docker volumes. Use only in development.

Disaster recovery checklist

Provision a host that meets Requirements, install NixStream, restore .env (update APP_URL if the domain moved), restore the database dump and storage (or re-point S3 credentials), swing DNS, re-issue SSL, then confirm queue workers and live ingest.

Disk layout: Storage. Day-to-day checks: Monitoring. Upgrade notes: Changelog.

On this page