Purpose
Your data on the XNS network is protected by its design: 80 data and 40 parity shards across independent providers on a decentralized network, with math-based active repair that runs automatically from the conditions your Relayer sees, for provable 11 nines durability (the math is here). The one piece you keep is the Relayer’s own backup, which holds its configuration, keys and databases. This guide is for the person who runs a Relayer. It covers what that backup holds, how to keep a copy somewhere safe, how to take a backup when you need one, and how to reinstall the Relayer on a new host and restore it.
Recovery is yours to run. How quickly you are back online depends on the
backup copy you kept off the host and the host you restore onto, and XNS makes no commitment
on recovery time. Our technical support will help you through any step of it; see
Getting help at the end of this page.
The commands below assume you installed the Relayer with the one-command installer, so its
files are in /opt/xns-relayer and its container is named
xns-relayer. Run them on the Relayer’s host. If you installed it another way, use
the path to your own docker-compose.yml.
Content summary
What a backup holds — the Relayer’s configuration and credentials, its
encryption keys and both of its databases. That includes the master secret your data is
encrypted under, so store every copy as carefully as a key. It does not hold object data;
that is on the network.
When backups run — every hour, on by default, and the last five are kept.
They are written inside the Relayer, on the same disk as everything else.
Your part — keep a copy somewhere other than that host. A backup that only
exists on the host is lost with the host.
Reinstalling — install the same Relayer release on a new host, put the backup
in it, restore it twice from the dashboard, restart the Relayer, point your endpoint at the new
host, and write again anything the backup missed.
The one rule — never let the old and the new Relayer run against the same
buckets at the same time.
What a backup holds
| Part | In the backup? | Notes |
|---|---|---|
| Configuration and credentials | Yes | Settings, TLS certificates, API keys, the Relayer’s sign-in to the network, and the Cloudflare token used to renew a Let’s Encrypt certificate. This includes the master secret, /relayer/conf/hostiosecret, that every storage key is derived from. |
| HostIO encryption keys | Yes | They only work with the master secret they were made under, so restore them together with the configuration and credentials, as the steps below do. |
| The Relayer database | Yes | The map from your objects to the hosts that store them. |
| The S3 gateway database | Yes | Your IAM users, groups and roles. |
| Samba passwords | Yes | So file-share sign-ins keep working after a restore. |
| Object data | No | It is on the network, and the restored database and keys find and decrypt it. |
| Writes not yet uploaded to the network | No | A write waits on the Relayer’s local disk until it has uploaded. See Known limits. |
| Monitoring history and logs | No | Metrics, alert history, container logs and the local audit log file stay on the old host. |
docker-compose.yml and .env | No | They live in /opt/xns-relayer, outside the Relayer. The compose file names theexact release you run, and .env holds settings such as where alerts are sent.Keep copies of both with your backups. |
| A database you run yourself | No | If you turned Local Database off and pointed the Relayer at your own PostgreSQL server, back that database up with your own tools. This guide assumes the built-in database, which is the default. |
Where backups are kept and when they run
Each backup is one zip file in the Relayer’s backup folder, /relayer/backup/
inside the xns-relayer container. That folder is on the Relayer’s data volume,
on the same disk as its database and its keys. The file name is the time the backup was
taken, in milliseconds since 1970, for example 1761955200000.zip. The dashboard
shows it as a date and time in UTC. The zip file is not encrypted.
The settings are under Configure in the menu, on the Backup
tab, in the Relayer Backup section:
| Setting | Default | What it does |
|---|---|---|
| Automatic Backups | On | Takes backups on the schedule below. Leave it on: while it is off, the tab showsBackups currently disabled and you cannot take, download or restore a backupfrom the dashboard. |
| Frequency | 60 Min | How often a backup is taken: 30, 60, 90 or 120 Min, Daily or Weekly. The first scheduled backup runs one period after the Relayer starts. |
| Retention | 5 backups | How many backups are kept. After each new backup, the oldest ones beyond this number are deleted. Backups you take with Backup Now count too. |
After a large upload, take a backup with Backup Now rather than waiting for
the next scheduled one.
Keep a copy off the host
Why it matters. The backups sit on the same disk as the Relayer. If that disk
or that host is lost for good, the database, the keys and the backups go with it. Your data on
the network survives, but only that database and those keys can find and decrypt it. The copy
you keep somewhere else is what a recovery runs on.
Guard it like a key. A backup holds the master secret your data is encrypted
under, along with your credentials, and the zip is not encrypted. Anyone who holds a copy
holds the keys to your data. Keep copies where only the people who run the Relayer can reach
them. If a copy goes anywhere shared, encrypt it first with a tool you already trust and keep
the passphrase apart from the copy.
Never keep the only copy in a bucket on the same Relayer. You need a working
Relayer to read it back, and that is the thing you would be recovering.
There are two ways to make the copy:
- From the dashboard. On the Backup tab, choose
Download on a backup’s row. The file is saved on the computer your browser
runs on. - From the host, on a schedule. This copies every backup in the Relayer
into arelayer-backupsfolder, and is safe to run again and again:sudo docker cp xns-relayer:/relayer/backup/. ./relayer-backups/Then move that folder off the host, to another server, a NAS or storage at another site, with
the tool you already use for off-site copies. Run it at least as often as the backup
Frequency, for example from cron.
Keep the Relayer’s two install files with the backups, so you can install the same release
later:
sudo cp /opt/xns-relayer/docker-compose.yml /opt/xns-relayer/.env ./relayer-backups/Take a backup now
On the Backup tab, choose Backup Now. The dashboard shows
Backing up database, please wait..., then Backup completed, and the new
backup appears in the list. Copy it off the host as above.
Take one:
- right after you set up a Relayer, since the first scheduled backup only runs one
Frequency period later; - after a large upload;
- before you change settings or upgrade;
- before a planned move to new hardware (step 1 below).
Reinstall on a new host and restore
Use these steps when the host is lost, the disk fails, the database is corrupted, or you are
moving the Relayer to new hardware. You need:
- a new host that runs Docker, with fast local disk at least as large as the old host’s.
The restore brings back the old settings, including Maximum Cache Size; - your latest backup copy from off the host;
- the old host’s
docker-compose.ymland.env, if you kept them; - the XNS account that owned the old Relayer.
- Retire the old Relayer for good. Two Relayers acting on the same data is
the one thing the design does not tolerate (see Known limits).- If it is still running (a planned move): stop your clients writing to it. Open
Network Overview and wait until the HostIO panel shows
Pending: 0 B, which means every write has uploaded to the network. Choose
Backup Now, then Download that backup. Then stop the old
Relayer:sudo docker compose -f /opt/xns-relayer/docker-compose.yml downThis stops it and keeps its data on the disk. Never start it again there.
- If the host is lost: make sure it cannot come back on its old disk. The Relayer
starts again by itself whenever its host boots, so a repaired machine or a restored snapshot of
an old VM would bring it back. Wipe that disk, or boot the machine with its network unplugged
and run thedowncommand above first.
- If it is still running (a planned move): stop your clients writing to it. Open
- Install the same Relayer release on the new host.
- If you kept the old
docker-compose.ymland.env: install
Docker Engine with the Compose plugin, put both files in/opt/xns-relayer, and
start the Relayer. The compose file names the exact release, so the new host runs the same one.sudo docker compose -f /opt/xns-relayer/docker-compose.yml up -d - If you did not keep them: on Ubuntu 24.04 or Debian 12, run the one-command
installer. It installs Docker and the current Relayer release. The restore accepts a backup
taken on an earlier release.curl -fsSL https://releases.scpri.me/relayer/install.sh | sh
- If you kept the old
- Sign in with the same XNS account. Open
http://NEW-HOST:8888in a browser and sign in with the XNS account that owned the
old Relayer. Signing in connects the new Relayer to the same installation on your account; it
does not add a second one. Do not create buckets, upload files or change settings yet: the
restore replaces the databases and the configuration, so anything you do before it is lost. If
the dashboard asks whether to set up a certificate, choose Keep local HTTP for
now; the restore brings back the old host’s certificate. If you sign in with
a different account, the restored Relayer shows
This Relayer belongs to another account. - Put the backup in the new Relayer’s backup folder. Copy the backup file
onto the new host, then into the Relayer, using your own file name:sudo docker cp ./relayer-backups/1761955200000.zip xns-relayer:/relayer/backup/Open Configure, then the Backup tab. The backup appears in the
list under the date and time it was taken. Restore it right away: the Relayer keeps only the
newest five backups, so an older one you copied in is deleted once five newer ones exist. - Restore everything. Choose Restore on that backup’s row.
In Restore Backup, leave all four boxes checked: Databases,
Configuration & credentials, HostIO encryption keys and
Samba passwords. Choose Restore and wait for
Restore completed successfully.Then choose Restore on the same
backup a second time, with the same four boxes checked, and wait for the same message. On a new
host the storage engine is still running under the new host’s own keys during the first
restore, and as it stops it writes them over the restored ones; the second restore puts the
backup’s keys back while it is stopped. After only one restore the storage engine does not
start: Network Overview shows no HostIO version, and S3
requests fail withServiceUnavailable. If the dashboard shows
Restore failed — check connectivity and try again., wait a moment and choose
Restore again; if it keeps failing, contact support with the
Relayer’s log (see Getting help). - Restart the Relayer. The restore restarts the storage engine on its own,
but the S3 gateway keeps the settings it loaded when it started until the whole Relayer
restarts:sudo docker compose -f /opt/xns-relayer/docker-compose.yml restart relayerSign in again when the dashboard comes back. If the old Relayer served its dashboard over
HTTPS, the new one does too after the restart, so usehttps://NEW-HOST:8888. - Point your endpoint at the new host. Move your DNS name to the new host’s
address, and allow the same ports through your firewall that the old host allowed: 9000 for
S3 over HTTP, 9443 for S3 over HTTPS, and 8888 for the dashboard. Your certificate came back
with the configuration. A Let’s Encrypt certificate issued from the dashboard keeps renewing
through Cloudflare DNS. - Write again what the backup missed. Re-upload everything written from a
while before the backup was taken onward, since writes can wait on the local disk for ten
minutes or more before they reach the network. Overwrite rather than sync, because a sync
skips files the listing already shows:rclone copy --ignore-times /path/to/source xns:my-bucketAfter a planned move where Pending read 0 B before the
backup, there is nothing to write again. - Take a fresh backup and copy it off the new host. Choose
Backup Now and copy it off as described above. Once the new Relayer passes
the checks below, wipe the old host’s Relayer data so it can never start again. On the old
host, this deletes its volumes:sudo docker compose -f /opt/xns-relayer/docker-compose.yml down -v
Check that it worked
- The dashboard knows you. You are signed in as the owner, with no
This Relayer belongs to another accountmessage, and the settings under
Configure match the old host’s. - The storage engine is connected. On Network Overview, the
HostIO panel shows a version and counts of data and parity hosts. If it shows
no version, choose Restore on the same backup again (step 5), then restart the
Relayer (step 6). - Your existing keys work. List your buckets with the tool and access keys
you already use, for examplerclone lsd xns:. Check one IAM user’s key as well as
the owner’s. - Your data reads back. A listing is not proof. Read the data back and
compare it with your source:rclone check --download /path/to/source xns:my-bucketAn object that is listed but fails to read had not finished uploading when the backup was
taken; write it again as in step 8. Migrating an S3 bucket
to XNS with rclone explains why--downloadis the check that works. - HTTPS clients connect. Clients on port 9443 are served the same
certificate as on the old host, so they connect to your DNS name as they did before. - A fresh backup is off the new host.
Known limits
- Your recovery point is the last backup you kept off the host. Objects
written after it are not in it and need to be written again. - Writes that were still uploading are listed but cannot be read. Objects
that had not finished uploading to the network when the backup was taken keep their place in
the bucket listing after the restore, but reading them returns an error. Because the listing
shows them, a sync tool treats them as already there and skips them. Rewrite them by
overwriting, as in step 8, and verify withrclone check --download. - Never run two Relayers against the same buckets. Each Relayer’s database
is its own map of which hosts hold which pieces of your data. When one Relayer deletes or
overwrites an object, it removes that object’s pieces from the hosts while the other still
points at them, and each one repairs and moves pieces according to its own map. Objects are
lost for both, and no backup brings them back. This covers the old host returning on its old
disk, a restored snapshot of an old VM, and the same backup restored onto two new hosts. To
run a second Relayer, give it its own buckets. - Monitoring history and logs start empty on the new host.
- Older backups are deleted automatically. Only the newest backups up to
Retention are kept on the host, which is one more reason to keep copies off
it. - Automatic Backups must stay on to take, download or restore a backup
from the dashboard. - No recovery-time commitment. Recovery is yours to run, and XNS makes no
commitment on how long it takes. Keeping a recent copy off the host and a standby host ready
is what shortens it.
Getting help
Our technical support will help you through any step on this page. Open a ticket from
Support in the xns.tech menu, at
console.xns.tech/submit-ticket (sign in
with your XNS account), or reach us through xns.tech/contact.
To help us help you quickly, include:
- the release you run, from the image line in your compose file:
grep 'xns-relayer:' /opt/xns-relayer/docker-compose.yml; - the date of the backup you are restoring;
- the step you are on and the exact message the dashboard showed;
- the Relayer’s recent log:
sudo docker compose -f /opt/xns-relayer/docker-compose.yml logs --tail 500 relayer
Do not attach a backup file, or paste your master secret or access keys into a ticket. They
are the keys to your data.
For every setting on the dashboard’s Backup tab, see
Configure.
