Backup and restore
Where 3R Monitor keeps its data, how long it keeps it, and how to back it up or move the master to a new server.
Where the data is
| What | Where |
|---|---|
| Program | /opt/3rmonitor (the 3rmonitor command; agent packages in /opt/3rmonitor/dist) |
| Configuration | /etc/3rmonitor/ (master.conf, agent.conf) |
| Data (master) | /var/lib/3rmonitor: the SQLite database monitor.db, with its -wal and -shm files, the IP-to-country database, and the master's signing key signing.key |
| Trusted approval keys (each agent) | /var/lib/3rmonitor-helper, managed with 3rmonitor approvers |
Agents keep no monitoring data apart from agent.conf and the keys they trust: everything is on the master. You only need to back up the master.
How long data is kept
| Data | Kept | Setting |
|---|---|---|
| Check results and charts | 30 days | Settings → Days to keep history |
| Per-IP traffic statistics | 30 days | Settings → Days to keep IP statistics |
| Traffic usage per server and day | 13 months | — |
| Incidents | 1 year | — |
| Resolved vulnerabilities | 90 days | — |
| Email log | 30 days | — |
| AI reports | 180 days (the 30 most recent are always kept) | — |
The System page shows the size of the database.
Back up
Stop the master, copy the data directory and the configuration, and start it again. It takes a few seconds; agents simply report again when the master is back.
sudo systemctl stop 3rmonitor-master
sudo tar czf /root/3rmonitor-backup-$(date +%F).tar.gz /var/lib/3rmonitor /etc/3rmonitor
sudo systemctl start 3rmonitor-masterCopy the file to another machine. It contains the panel's accounts, the SMTP password, the agents' tokens, the AI API keys and the master's signing key: keep it somewhere safe.
Restore, or move the master to a new server
On the new server, install the master with the same version or a newer one.
Copy the backup to it and restore it:
sudo systemctl stop 3rmonitor-master
sudo tar xzf /root/3rmonitor-backup-DATE.tar.gz -C /
sudo chown -R 3rmonitor:3rmonitor /var/lib/3rmonitor
sudo systemctl start 3rmonitor-masterIf the master's address changed, point the agents to it: update the DNS record of the panel domain (nothing else to do), or change master_url on each agent, for example with sudo 3rmonitor bind --master NEW_URL --token TOKEN.
The backup includes the master's signing key, so servers keep trusting the restored master for AI approvals. Passkeys belong to the host name you open the panel with: if that changes, they no longer work, so follow If every passkey is lost.
Using a domain name for the panel, instead of an IP, makes moving the master much easier: you only change the DNS record, and every agent follows.