restore
Restore accounts, databases, SSL certificates, or folders from local or remote GoAdmio backups
- Command:
/go/restore - Category: Backup
- Required option: None (the first argument selects what to restore; see Syntax)
- Output: Plain-text progress; email and WhatsApp notifications for remote restores
- Last updated: 2026-11-19
On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also
Overview
/go/restore is the counterpart of backup. It can:
- restore one account from an archive in
/backup, or find the newest archive for a domain - restore every archive in
/backup - download a dated backup from the saved remote destination, then restore one account or all of them
- restore GoAdmio's own SQLite databases from a remote backup
- restore Let's Encrypt certificates saved by
backup ssl - restore cPanel full backups (see cPanel archives)
Account restores recreate the account with create, then put back files, subdomains, mail, the Linux password, and databases.
The command re-runs itself with sudo when started by a non-root user, and appends every call to /var/log/go/restore.log.
Quick start
# Restore the newest archive for a domain from /backup
/go/restore example.com
# Restore every archive in /backup
/go/restore all
# Download and restore every account from a dated remote backup
/go/restore all 2026-11-19
Syntax
/go/restore <domain>
/go/restore <archive>.tar.gz
/go/restore all
/go/restore all <YYYY-MM-DD> [<hostname>] [--storage secondary|tertiary]
/go/restore <archive>.tar.gz <YYYY-MM-DD> [<hostname>] [--storage secondary|tertiary]
/go/restore database <YYYY-MM-DD> [<hostname>] [--storage secondary|tertiary]
/go/restore ssl
| Form | Behavior |
|---|---|
/go/restore <domain> |
Restores the newest archive in /backup for that domain. |
/go/restore <archive>.tar.gz |
Restores that archive. It is looked up in /backup, then in /backup/<hostname>/<date>/, then on the remote destination. |
/go/restore all |
Restores every *.tar.gz file in /backup, newest first. |
/go/restore all <date> [<hostname>] |
Downloads the whole dated backup from the remote destination, then restores every account in it. |
/go/restore <archive>.tar.gz <date> [<hostname>] |
Downloads that one archive from the remote destination, deletes the existing account, and restores it. |
/go/restore database <date> [<hostname>] |
Restores GoAdmio's SQLite databases from the remote backup. go works as an alias for database. |
/go/restore ssl |
Restores certificates from /var/go/ssl into /etc/letsencrypt, then rebuilds the web server and mail SSL configuration. |
How the arguments are read:
- The second argument is a backup date when it doesn't contain
--. A date (any value containing-) selects a remote restore. - The third argument is the hostname of the server the backup came from, and only counts when it contains a dot. Without it, this server's hostname is used.
--storageand--skipare found anywhere in the command line. See Options.
With no arguments the command exits without output.
Options
| Option | Default | Notes |
|---|---|---|
--storage secondary |
Primary | Reads /var/go/etc/secondary.conf instead of the primary destination file. |
--storage tertiary |
Primary | Reads /var/go/etc/tertiary.conf. |
--skip mysql |
— | Creates the databases and users but does not import the MariaDB dumps. Used internally after a MariaDB hot-backup restore. |
Everything else is positional. A <hostname> argument only matters for remote restores; it names the folder <remotedir>/<hostname>/<date> that the backup was written to.
Archive names follow <type>-backup-<date>-<domain>.tar.gz (see backup).
Output
The command prints plain-text progress, one block per account:
[3/42] Restoring example.com...
Restoring example.com Files...
Restoring example.com Email Accounts...
Restoring MySQL/MariaDB Database example_db...
Remote restores (all <date> and <archive> <date>) also send an email and a WhatsApp message when they start, for each account, and when they finish. The final message always reads Restoring All Sites (<date> | <hostname>), even for a single account.
The create step prints its own JSON with the new account's login details.
Security
[!WARNING] A restore changes the system in ways that are hard to undo. Read What it overwrites first.
- The saved Linux password line for the account is printed to the terminal when it is written back to
/etc/shadow. - The MariaDB hot-backup restore reads the root password in plain text from
mysql/mariadb.pwdand sets the server's root password to it. - Every call is appended to
/var/log/go/restore.log.
Examples
# Newest archive for a domain in /backup
/go/restore example.com
# A specific archive (fetched from the remote destination if it isn't local)
/go/restore full-backup-2026-11-19-example.com.tar.gz
# Restore files, settings, and mail but not the MariaDB dumps
/go/restore full-backup-2026-11-19-example.com.tar.gz --skip mysql
# Restore every account from the primary remote backup of 19 November
/go/restore all 2026-11-19
# Restore everything from another server's backup folder
/go/restore all 2026-11-19 old-server.example.com
# Same, from the secondary destination
/go/restore all 2026-11-19 --storage secondary
# Restore GoAdmio's own databases
/go/restore database 2026-11-19
# Restore saved Let's Encrypt certificates
/go/restore ssl
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Instance (<name>) already running. |
A restore or backup holds /usr/local/goadmio/lock/backup.lock and it was updated in the last hour. Runs that don't start with a domain or archive name share this lock with backup. |
Wait. If it is stale, delete the lock file. |
| No output at all | No arguments, or <domain> matched no archive in /backup. |
Put the archive in /backup, or pass its full name. |
Username <user> already exists |
The account is already registered. | Delete it with delete first, or restore remotely, which deletes it for you. |
Invalid domain name <name> |
The archive's settings or cPanel data have no valid domain. | Check the archive contents. |
Directory /backup/<dir> not exists. |
The archive extracted to a differently named folder. | Rename the archive to match its internal folder. |
Directory /home/<domain> already exists. |
A home folder is already there. | Informational: the restore continues. Check the result. |
Database '<name>' already exists. |
A database with that name is already registered. | It is skipped. Drop it first to restore its dump. |
Remote backup backup:<host>/<date> does not exist |
Wrong date or hostname. | Use one of the Available Backup Dates printed below the message. |
Backup not Exists, Try another backup date. |
The archive is not on the remote destination. | Check the date and archive name. |
REMOTE: Invalid password |
The saved scp password could not be decrypted. |
Save the destination again with backup. |
File /var/go/etc/<storage>.conf: No such file |
No destination is saved on this server. | Run backup --setup 1 with the same remote settings first. |
| A remote restore downloads nothing | The saved destination is not rclone (or legacy scp). |
See Remote restores. |
Details
Mode selection
flowchart TD
A["restore ..."] --> B{"First argument"}
B -- "database, go" --> DB["Download SQLite databases, exit"]
B -- "ssl" --> SSL["Restore certificates, exit"]
B -- "other" --> C{"Second argument is a date?"}
C -- "Yes" --> R["Remote restore"]
C -- "No" --> D{"First argument is all?"}
D -- "Yes" --> L["Restore each archive in /backup"]
D -- "No" --> E["Find and extract one archive"]
R --> E
L --> E
E --> F{"Archive type"}
F -- "cPanel" --> CP["cPanel restore"]
F -- "GoAdmio" --> GO["Account restore"]
Finding the archive
| You pass | Lookup |
|---|---|
<archive>.tar.gz |
/backup/<archive>; then /backup/<hostname>/<date>/<archive> (date from the file name), which is moved to /backup; then the remote destination. |
<domain> or a cPanel username |
The newest file in /backup whose name ends in -<name>.tar.gz (GoAdmio) or _<name>.tar.gz (cPanel). |
The archive is extracted in /backup into a folder named after the archive, and that folder is removed when the restore ends. The .tar.gz itself is normally kept.
Remote restores
Remote restores read the saved destination from /var/go/etc/<storage>.conf (--storage picks the slot) and use the rclone remote named backup. A RemoteDir of empty, -, or / means the remote root.
| Saved destination | Download |
|---|---|
rclone |
rclone copy of the dated folder. |
scp (legacy) |
rsync over SSH using the saved, encrypted password. |
| Anything else | Nothing is downloaded. |
all <date> does the following:
- Sends the start notification and creates
/backup/<hostname>/<date>. - Checks that
<hostname>/<date>exists on the remote. If not, prints the available dates and stops. - Downloads the whole dated folder (account archives,
mysql/,var/go/,var/lib/sqlite/). - If no account is registered on this server and
mysql/mariadb.pwdexists, restores the MariaDB hot backup (see below) and skips the per-account dump imports. - Restores each archive, newest first, with a notification for each.
- Runs
sslfor all accounts and sends the finish notification.
MariaDB hot-backup restore. Resets the MariaDB root password to the saved one with mysqlreset, stops the cron jobs and MariaDB, empties /var/lib/mysql, runs mariadb-backup --decompress, --prepare, and --copy-back, fixes ownership, then restarts MariaDB and the cron jobs.
<archive> <date> downloads that one archive, runs delete <domain> --force on any existing account, and restores the archive.
database <date> copies <remotedir>/<hostname>/<date>/var/lib/sqlite/ into /var/lib/sqlite/ and sets ownership to go:go.
Account restore
This is what happens for a GoAdmio archive (one containing log/include/site.conf):
- Loads the account settings from
site.conf. Stops if the same domain and username are already registered. If no password was saved, a random one is generated. - If
/home/<domain>does not exist and the archived PHP version isn't installed, uses the newest installed version. - Creates the account with
create. - Replaces
www,sqlite, andmailin/home/<domain>with the archive's copies, where present. - Recreates subdomains from
log/subdomain/*.confwithsubdomain. - Recreates mail accounts with
mailfrom the saved per-mailbox settings. - Writes the saved Linux password line back to
/etc/shadow, then runsfix. - For each MariaDB dump in
log/mysql: skips it if the database is already registered; otherwise creates the database and user withmysql, imports the dump (unless--skip mysql), and reapplies the saved password hash. - For each PostgreSQL dump in
log/postgre: same, usingpostgreandpsql. - Removes the extracted folder.
cPanel archives
An archive that contains a homedir folder is treated as a cPanel full backup. The domain is the first sub-folder of homedir/etc with a dot in its name, and the username comes from meta/homedir_paths (or defaults to the domain).
| Setting | Value |
|---|---|
| Password | Random 16 characters |
info@<domain> |
|
| PHP version | The last version found in /etc/opt/remi (RHEL-family only) |
| FTP / email / database / subdomain limits | 100 / 1000 / 100 / 100 |
| Alias / addon limits | 1 / 0 |
| Permission | secure |
| SSL certificate and redirect | On |
| Hosting expiry | One year from today |
| Mail TTL | 180 |
homedir/public_html becomes www, and homedir/mail/<domain> becomes mail. Mailboxes are recreated from the mail folders, but their passwords are not carried over. Each .sql file in mysql/ becomes a database (dashes removed from the name, user named after it), and mysql.sql is applied afterwards. The roundcube database is skipped.
What it overwrites
| Action | Effect |
|---|---|
database |
Overwrites GoAdmio's SQLite databases in /var/lib/sqlite. |
<archive> <date> |
Deletes the existing account with delete --force before restoring. |
all <date> on a server with no accounts |
Stops MariaDB, empties /var/lib/mysql, and replaces the MariaDB root password. |
| Account restore | Replaces www, sqlite, and mail in the account's home folder, and the account's line in /etc/shadow. |
ssl |
Copies certificates with --ignore-existing, so existing ones are kept. |
Requirements
| Tool | Needed for |
|---|---|
pv |
Installed automatically with dnf or apt if missing. |
rclone |
Remote restores and database. |
sshpass, rsync |
Legacy scp restores and ssl. |
mariadb-backup |
MariaDB hot-backup restore. |
See also
| Command | Description |
|---|---|
backup |
Back up one or all accounts to local disk or remote storage, manually or on a schedule |
recover |
Restore a deleted account from its latest snapshot |
snapshot |
Restic-based per-domain snapshot backup and restore |
serversync |
Back up and migrate a GoAdmio server with all configurations |
create |
Create a GoAdmio account from the command line |
delete |
Delete a GoAdmio account from the command line |
ssl |
Install an SSL certificate for a domain in GoAdmio |
mysqlreset |
Change the MySQL root password in safe mode |
cron |
Set up main cron jobs in GoAdmio |