Backing Up the Panel
A MyOsicam panel stores its authoritative state in two places: the MySQL/MariaDB database and the filesystem. Both must be included in any backup that you want to be able to restore from. OScam itself runs on separate servers managed by your agents and is not affected by panel backups or restores.
What to back up
1. The panel database
The MySQL/MariaDB database is the system of record for everything the panel manages:
- Registered OScam installs and their configuration.
- Agent registrations, tokens, and heartbeat history.
- OScam user accounts and subscription records.
- Install groups, resource readings, cron logs, and audit events.
- Panel update events and settings.
All panel tables live in the database named in your panel’s DB_DATABASE environment variable
(default: myosicam_panel).
2. The panel filesystem
The files you need to back up from the panel host:
| Path | Why |
|---|---|
<panel-root>/config/.env | All environment variables: DB credentials, PANEL_ENCRYPTION_KEY, license key, URLs. |
<panel-root>/panel_users/ | One file per OScam user account — written atomically by the panel. |
/etc/nginx/sites-available/ | Your Nginx vhost, including TLS certificate paths. |
/etc/cron.d/myosicam-panel | The cron schedule that drives the hourly update check and resource monitoring jobs. |
3. TLS certificates
If you are using Let’s Encrypt (Certbot), certificates auto-renew via the Certbot timer and do
not strictly need to be in your backup. If you are using custom TLS certificates, include
/etc/nginx/ssl/ or whichever directory holds your certs.
Taking a consistent database backup
Use mysqldump on the panel host. The --single-transaction flag keeps the backup consistent
without locking tables for the duration of the dump:
mysqldump \ --host=127.0.0.1 \ --user=myosicam \ --password \ --single-transaction \ --routines \ --triggers \ myosicam_panel > panel_backup_$(date +%Y%m%d_%H%M%S).sqlReplace myosicam with your panel database username if it differs.
Taking a filesystem backup
After the database dump, archive the panel config and user files:
# Set PANEL_ROOT to your panel installation directory (adjust if yours differs)export PANEL_ROOT=/var/www/myosicam
tar -czf panel_fs_backup_$(date +%Y%m%d_%H%M%S).tar.gz \ "$PANEL_ROOT/config/.env" \ "$PANEL_ROOT/panel_users/"Restoring from a backup
Restore the database
mysql \ --host=127.0.0.1 \ --user=myosicam \ --password \ myosicam_panel < panel_backup_YYYYMMDD_HHMMSS.sqlRestore the config and user files
tar -xzf panel_fs_backup_YYYYMMDD_HHMMSS.tar.gz -C /After restoring config/.env, verify that the PANEL_ENCRYPTION_KEY value matches what was
active when the database was backed up. A mismatch will cause decryption of stored WebIF
passwords and saved server passwords to fail silently.
Verify the restore
After restoring both database and filesystem:
- Restart PHP-FPM:
sudo systemctl restart php8.3-fpm - Log in to the panel and confirm that your installs, agents, and users appear correctly.
- Check the Agents list — agents will reconnect and resume heartbeating on their own schedule once they can reach the panel URL again.
What the backup does NOT include
- OScam itself — OScam runs on your remote servers managed by agents. Each server’s OScam binary, configuration, and user files live on that server and are not part of a panel backup.
- Agent binaries — the agent binary on each OScam server is not stored on the panel host. If you need to reinstall an agent, use Re-run Bootstrap from the agent detail page.
Related pages
- Secrets Rotation — rotate encryption keys and HMAC secrets.
- Applying Panel Self-Updates — the panel update mechanism.
- Troubleshooting / FAQ — general help for panel issues.