Backup Center
This page covers hosting account backups: storage destinations, schedule and retention policies, integrity verification, automatic restore tests, and how to restore and download backups. It is written for admins and technicians.
Open Backup Center in the Infrastructure group.
Panel backup
This page covers hosting account backups. Backups of the panel database, keys, and agent CA are covered in Panel backup and DR.
How backups work
MoorCP uses restic, with one encrypted repository per account.
- Backups are not daily
username.tar.gzarchives. Data is split into blocks, each block is stored once (deduplication), compressed, and encrypted with AES-256. - Later backups only send blocks that changed, but every snapshot is still complete. Restoring or downloading any snapshot does not need a full + incremental chain.
- Retention deletes old snapshots and blocks no other snapshot uses.
- A snapshot contains the account's whole home directory, Maildir, and MariaDB and PostgreSQL database dumps.
The encryption key is derived from the agent's master key on each hosting server, /etc/moorcp/backup/master.key.
Keep master.key off the server
Each hosting server has its own master.key. Without that key, backups cannot be opened. Keep a copy somewhere safe outside the server.
Backup Center overview
The Overview tab shows:
| Card | Contents |
|---|---|
| Latest success | The last successful backup. Flagged when older than the hour limit in the settings. |
| Active policies | The number of active policies and the default policy. |
| Protected accounts | The number of accounts included in backups and those whose last backup failed. |
| Offsite status | Off-host when every active policy stores backups outside the server, or Needs attention. |
Below it are Backup destinations, Policy summary, Account backups & snapshots, and Recent backups.
Other tabs: Destinations, Policies, and Terminated accounts.
Storage destinations
Destinations are managed in the Destinations tab. Only admins can add or change them.
| Type | Fields | Secret |
|---|---|---|
| Local | Path on the server: an absolute path outside /home. | - |
| SFTP | Host, port, user, path. | SSH private key |
| S3 | Endpoint (https), region, bucket, Prefix (optional), access key ID. | Secret access key |
| R2 | Cloudflare account ID (32 hex characters), bucket, prefix, access key ID. | Secret access key |
Adding a destination
- Click Add destination.
- Fill Name: lowercase letters, digits, and hyphens. The name cannot be changed later.
- Choose the Type, then fill its fields.
- Click Save.
- Click Test on the destination's row.
Secrets are stored encrypted and never shown again. When editing a destination, leave secret fields empty to keep the stored values.
The connection test runs from a server's agent: it creates a small repository, writes, reads, then deletes it, with a 90-second time limit. The Last test column shows the result. A destination that fails its test raises the backup_destination_failed alert.
SFTP
The SFTP server's host key is recorded by the agent on the first connection. The SFTP server must accept the public key of the key pair you entered.
Local destinations
A Local destination stores backups on the production server itself. If the server breaks, the backups are lost with it. An active policy with a local destination raises the backup_onhost_only alert until backups are also sent to SFTP, S3, or R2.
Deleting a destination from the panel does not delete the snapshots already in storage.
Per-server folders
Each hosting server gets its own folder on the destination, named after the server's hostname:
<destination>/
├── srv1.example.com/ server folder
│ ├── _server.json server id, hostname, IP, panel URL
│ ├── README.txt how to check and restore manually with restic
│ ├── jane/ restic repository of account jane
│ └── myshop/
└── srv2.example.com/- If the hostname is already used by another server on the same destination, the folder gets an 8-character server id suffix.
- The folder name is locked when first used, so changing the server's hostname does not break the repositories.
_server.jsonandREADME.txtare only written on Local and SFTP destinations.
Older servers may still use a folder named after the server id. To move it:
- Open the Destinations tab and click Edit on the destination.
- In the Server folders section, click Move to srv1.example.com on the server's row.
The move is refused while a backup, restore, check, or restore test job for that server is queued or running. S3 and R2 folders cannot be moved.
Manual check with restic
The README.txt in the server folder describes this. On the hosting server, as root:
export RESTIC_PASSWORD="$(moorcp-agent backup-password jane)"restic -r sftp:moorcp@backup1.example.com:/backup/srv1.example.com/jane snapshotsBackup policies
A policy sets the schedule, destination, retention, scope, verification, and account filters. Open the Policies tab, then click New policy or Edit.
Schedule, destination, and scope
| Field | Notes |
|---|---|
| Name | Policy name. |
| Destination | Storage destination. Destinations on the production server are flagged. |
| Hour (UTC), Minute | Daily backup time, in UTC. |
| Scope | Files and/or Databases. |
| Enabled | The policy runs. |
| Default for accounts without a policy | Used by accounts that have no policy of their own. |
Times are in UTC
The schedule uses UTC. For 02:00 at UTC+7, enter 19 (19:00 UTC the day before).
Retention
| Field | Meaning |
|---|---|
| Keep last | The number of most recent snapshots always kept. |
| Keep daily | One snapshot per day, for N days. |
| Keep weekly | One snapshot per week, for N weeks. |
| Keep monthly | One snapshot per month, for N months. |
Verification
| Field | Default | Meaning |
|---|---|---|
| Integrity check every (days) | 0 = 7 days | Repository integrity check. -1 = off. |
| Data re-read | 5% | The share of data re-read and decrypted during the check. |
| Restore test every (days) | 0 = 30 days | Automatic restore test. -1 = off. |
Account filters
| Field | Meaning |
|---|---|
| Skip suspended accounts | Suspended accounts are not backed up on schedule. On by default in new policies. |
| Skip accounts larger than (GB) | Accounts above the limit are skipped. Empty or 0 = no limit. |
| Only these packages / Exclude packages | Restrict to or exclude packages. Empty = all packages. |
| Only these servers / Exclude servers | Restrict to or exclude servers, for example servers that have their own backups. |
| Exclude accounts (usernames) | Usernames separated by commas or spaces. |
| Exclude paths (one per line) | Relative to the account's home. With / it means that path (public_html/cache). Without / it matches anywhere (*.log, node_modules). At most 50 patterns. Patterns never remove the database dumps or account.json from a snapshot, even a pattern such as *.gz or *.sql.gz. |
Click Save policy.
Skipped accounts are recorded in the audit log with the reason. Accounts skipped because of the disk limit also raise the backup_skipped_disk_limit alert, so no account quietly goes without backups.
Account backup status
The Account backups & snapshots card shows each account: its policy, whether it is included or skipped and why, the next schedule (UTC), and the last backup. Filter with Show: All accounts, Included, Skipped, or Last backup failed.
Skip reasons: No policy, Policy disabled, Suspended, Over disk limit, Package excluded, Account excluded, Server excluded, or Account inactive.
Global settings
Click Settings in the Backup Center. These settings apply to all policies.
| Section | Setting | Default |
|---|---|---|
| Client access | Clients can restore their backups | On |
| Clients can download backups | On | |
| Clients can start a manual backup | On | |
| Notifications | Alert when an account's last backup failed | On |
| Alert when no successful backup for (hours) | 48. 0 = off. | |
| Content and storage | Always exclude (one pattern per line) | Empty. Added to every policy's filters. Database dumps and account.json are always kept. |
| Compression | auto. max saves more space at higher CPU cost. | |
| Accounts backed up at the same time (per server) | 1. From 1 to 8. See Backup queue and parallel backups. | |
| Terminated accounts | Keep backups of terminated accounts for (days) | 0 = forever. |
Client access applies to the client panel and billing keys. Staff are never restricted.
Backup queue and parallel backups
Backups, integrity checks, and restore tests run in their own job queue, separate from other panel jobs. Issuing SSL, creating websites, changing packages, and restores never wait behind a scheduled backup window.
When a schedule starts, the panel creates one backup job per account. Each server runs at most Accounts backed up at the same time (per server) backups at once, and different servers run independently. A new value takes effect within about 15 seconds, without a restart.
- Parallel backups are safe because every account has its own restic repository. Two backups of the same account never run at the same time.
- restic runs at the lowest CPU and disk priority, and each process uses at most half of the server's cores (1 to 4). One backup of a large account uses about 400 MB of RAM.
- On a small VPS, keep 1. On a server with 8 or more cores and a fast destination, 2 to 4 shortens the backup window.
Integrity verification
Every new backup has its structure checked before it counts as successful. The panel also schedules periodic integrity checks according to the policy.
A structure check alone does not find data whose contents are corrupted. That is why the periodic check also re-reads and decrypts part of the data (Data re-read).
For a manual check, open Accounts › (account) › Backup, then run Integrity check.
A failed check raises the critical backup_check_failed alert with the restic error message.
Automatic restore tests
A restore test restores the latest snapshot to a temporary directory outside the home directory, then checks that:
- the file count and total size match the snapshot's contents;
- the account metadata can be read;
- every database dump decompresses fully and contains SQL;
- the number of email messages matches.
The temporary directory is deleted after the test. The test is skipped, not failed, when the server has less free disk space than the snapshot size + 20% + 1 GB.
For a manual test, open Accounts › (account) › Backup, then click Test restore. The result shows as passed or problems found in the account's Backup tab. A failure raises the restore_test_failed alert.
Restoring an account backup
Open Accounts › (account) › Backup.
In the Snapshots table, click Restore on a snapshot.
Choose What to restore:
Option What you pick Full account - File / folder A file or folder from the snapshot's folder list (folders first, then files, sorted by name) Database A database dump from the snapshot, marked MariaDB or PostgreSQL Mailbox A mailbox from the snapshot, grouped by domain The lists are read from the snapshot by the agent (
restic ls) without restoring anything. Type it instead switches to a text field: a path relative to home such aspublic_html/wp-content, a database name such asjane_shop(pgsql:jane_shopfor PostgreSQL), or a mailbox address. Snapshots on FTP storage cannot be listed and always use the text field. For a file or folder, Restore into a new folder restored-YYYYMMDD restores under~/restored-YYYYMMDD/instead of overwriting.Click Restore.
Restore overwrites data
A restore overwrites the current data in its original location. If in doubt, download the snapshot first or restore just one folder.
Database dumps are imported with the account's own database user, not as an admin. Only databases whose names start with the account prefix are restored; other dumps are skipped.
The Back up now button in the same tab creates a manual backup. Staff may run a manual backup even when the account is skipped by policy filters.
The Recent backup jobs table shows that account's latest backup, restore, integrity check, and restore test jobs.
Removing a snapshot
Admins can remove a single snapshot with Remove in the account's Backup tab (Snapshots table) or in Backup Center › Snapshots › Snapshots of an account. This also works for terminated accounts. Other roles, clients, and billing API keys cannot remove snapshots.
- The snapshot disappears from the list right away. The storage it used is freed at the next retention prune, which runs with the account's next scheduled or manual backup.
- Each removal is recorded in the audit log as
backup.snapshot_delete. - The snapshot tables show the Size of each snapshot (total size of its files, email, and database dumps). The size comes from restic 0.17+ or, with older restic, from the backup job that made the snapshot. — means the size is not known.
DANGER
Removing a snapshot cannot be undone. Download it first if it might still be needed.
Downloading a snapshot
Click Download on a snapshot. The panel creates a signed link, and the browser downloads the archive <username>-<YYYYMMDD-HHMM>-<snapshot>.tar.gz.
The archive is portable, so it can also be restored in another control panel:
<username>-<YYYYMMDD-HHMM>-<snapshot>/ ├── README.txt how to restore in MoorCP and other panels ├── account.json domains, databases, mailboxes ├── files/ the home directory, without mail ├── databases/ <db>.sql.gz, and postgresql/<db>.sql.gz └── mail/ <domain>/<user>/ MaildirPasswords of email accounts and database users are not included.
README.txtis written in the language of the person downloading, English by default.The archive is streamed straight from the server, not copied to disk, so it does not use account quota or server space.
The link is valid for 15 minutes by default.
If the transfer fails midway, the connection is cut so the archive looks incomplete, not like a valid archive.
Clients can restore such an archive themselves: they upload the .tar.gz to their home directory, then use Restore from archive in the client panel's Backup page. Files with the same name are replaced, database dumps are imported as the account (only databases whose names start with the account prefix), and mail is restored only for email accounts that already exist. See Backup in the client panel.
Client external backup
When a package has the External backup (client storage) feature, clients can also send backups of their account to storage they own, next to the backups from your policies. See Packages.
- A client can add up to 5 storages (SFTP/SSH, FTP/FTPS, S3, Cloudflare R2, or Google Drive) and up to 5 backup rules with their own schedule, content, and retention.
- Client storages do not appear in the Backup Center destinations, and admin destinations are never shown to clients.
- Each client storage has its own repository password, separate from the admin repositories. The client can view it to open the backup with restic without the panel. Viewing it is recorded in the audit log.
- Storage hosts that point to internal networks (loopback, private addresses, cloud metadata) are refused.
- When the package no longer includes the feature, the client's storages stay listed but scheduled backups to them pause.
The setup steps for clients are in Backup in the client panel.
Backups of terminated accounts
Terminating an account deletes all of its data on the server, but its backups are not deleted.
The Terminated accounts tab shows terminated accounts that still have backups: last server, deletion date, last backup, and when the backups will be deleted.
- Click Snapshots to view, download, and remove snapshots.
- Click Delete backups to delete all of that account's backups on every destination. Admins only.
When Keep backups of terminated accounts for (days) is more than 0, the panel deletes the backups automatically once the retention period ends.
DANGER
Delete backups cannot be undone. Download the last snapshot first if it might still be needed.
