Restore on a clean machine¶
This page describes how to bring a server back from a full backup run when the original machine is lost. It uses the one-shot server command, so no running server and no back office are needed.
What the backup contains¶
A full backup run contains the server stores listed in Participants: trading data, accounts, customers, configuration, cashier, prop, copy trading and the optional stores.
The backup does not contain files outside the stores. Keep copies of them by other means and put them back by hand:
| Item | Why it is needed |
|---|---|
storage/ folder |
Uploaded files: KYC documents, avatars, logos. storage.db is restored, but it only references these files |
config.toml |
Server configuration, including ports and credentials |
license.lic |
Licence |
| Plugin files | Installed plugins; plugins.db only lists them |
The backup also does not contain sign-in sessions, server metrics and dealer requests.
Steps¶
- Install the same or a newer server version on the new machine. Do not start it.
- Put back
config.toml,license.lic, the plugin files and thestorage/folder. - Copy the backup run directory to
backups/completed/<run_id>inside the server directory. The directory must containmanifest.jsonand the store files. If the run is on a remote backup server, copy<storage>/runs/<run_id>/<participant>/<file>files and_manifest/manifest.jsoninto that one directory. A run copied by hand is not checked against the server that created it. This is the way to restore from a run thatImportRemoteBackupRunrefuses: a run without a source, a run made before the license of the server was replaced, or a run of another server moved on purpose. Make sure the run is the one you intend to restore. -
Run the restore command from the server directory:
./server restore-run <run_id>The command validates the run, replaces the store files in
bases/, prints the result and exits without starting the server. Exit code0means the stores were restored. 5. Start the server as usual. 6. Sign in again: every sign-in session is reset by a restore. 7. Open the restore run in the back office and check the reconciliation result; see Reconciliation.
If the command fails¶
The command prints the reason and exits with code 1. The stores are not
changed unless the reason says that the previous stores could not be returned;
in that case the files moved away are in backups/pre-restore/<restore_id>.
The command refuses to work while the server is running in the same directory ("Server is running"): stop the service first, or schedule the restore from the back office.
If the server does not start after a restore¶
If the server process stopped during the store swap (crash, power loss), the next start moves the previous stores back and the server does not start. The log explains what happened. Because the service restarts automatically, the same message repeats until you choose one of the two commands (with the service stopped):
./server restore-run <run_id>
repeats the restore, or
./server restore-cancel
cancels it; then start the service as usual. restore-cancel also removes a
scheduled restore that has not run yet.
Typical reasons: the run is not in backups/completed, its status is not
completed or partial, it is a scoped run, or an artifact does not match the
size or checksum recorded in the manifest.
Notes¶
- The server must be stopped while the command runs; the command checks it.
- The stores are encrypted with the server key, so a backup can be restored only by a server build that uses the same key.
- A backup taken by a newer server version may contain a newer store layout than an older server understands. Restore with the same or a newer version.