Get your free beta license ↗
CMDCommand · run as root on the server · restore family

urbestack-restore

First published 3 Oct 20260.1.0Unchanged since publication

Usage

3 forms
# urbestack-restore (--name USER --day YYYY-MM-DD | --name USER --own FILE | --file /path/USER.tar.gz [--name USER] [--root-owned]) [--files | --mail | --database NAME | --records] [--as-customer] [--job ID]
# urbestack-restore --inspect (--name USER --day YYYY-MM-DD | --name USER --own FILE | --file PATH) [--as-customer]
# urbestack-restore --server /path/YYYY-MM-DD [--trust-files]

Description

From the command's --help output
Restores a customer from an UrbeStack archive or restores a whole backup day folder onto a fresh
installation.

With --name USER and --day YYYY-MM-DD, UrbeStack opens backups.dir/DAY/USER.tar.gz. With --name
USER and --own FILE, it looks for that filename in the customer's backups/ directory. Use --file
with an absolute path ending in .tar.gz for an archive outside the day folders, such as one
copied back from a remote backup host after a disk failure, brought from another server or
supplied by a customer. UrbeStack reads the customer name from account.json and accepts only
UrbeStack customer archives with a matching schema version. For an administrator restore, --own
and --file with --name require the archive to name the specified customer.

An administrator restore runs as root even if another user owns the archive. UrbeStack warns
that the owner could have changed it. Use --root-owned with --file to require a root-owned
regular file and refuse symbolic links. UrbeStack uses --name and --root-owned together when a
plugin supplies an archive path through the API.

With no scope option, UrbeStack restores the account records, the home directory with website
files and mail, and every database. Choose at most one scope option. --files restores the home
directory excluding mail. --mail restores mailbox contents. --database NAME loads one dump and
requires that database to be in the archive. --records restores only account records, including
domains, DNS records, mail accounts, databases and database users, SSH keys, FTP accounts,
protected folders, backup exclusions and cron jobs.

UrbeStack extracts files and mail over the existing home directory. Archived copies replace
matching files, and files absent from the archive stay in place. In an administrator restore,
each dump replaces the tables it contains through its DROP TABLE statements. UrbeStack recreates
missing databases, database users and grants from the archive. Archived records replace matching
records, and records absent from the archive stay in place. If the customer account is missing,
the administrator restore recreates it from account.json.

--as-customer applies the same restrictions as a restore from the customer's panel. It requires
an existing customer and accepts either that account's nightly backup with --day or a file in
its backups/ directory with --own. With --own, the file must be a regular file owned by the
customer. Symbolic links are refused. An administrator must restore a suspended account.
UrbeStack treats the archive as untrusted and restores into the account selected by --name,
regardless of whom the archive names. It runs tar as the customer and loads dumps as their
phpMyAdmin user, rewriting every DEFINER to that user.

Under --as-customer, records pass the same checks as records created by hand. For the customer's
existing domains, the restore can apply DNS records, mail accounts, forwarders, filters,
autoresponders, mailing lists, customer-configurable mail settings and FTP accounts. It can also
restore databases with their users and grants, SSH keys, backup exclusions and cron jobs. The
domains themselves, their domain settings and settings reserved for administrators stay as they
are. The restore report names the domains and settings it leaves out.

A customer archive restore reports progress, stops at the first failure and lists the steps
completed before it. Use --job ID to associate the restore with an existing job. By default,
UrbeStack creates a job for the restore. --inspect reads only account.json to report whom the
archive was made for and what it contains, without restoring it.

For a whole-server restore, copy the backup day folder back by hand and pass its absolute path
to --server on a fresh installation of the operating system and UrbeStack. The folder must
contain the server profile export server.json. UrbeStack checks for the PHP versions the sites
use and for any required mail stack, MariaDB and FTP services. If anything is missing, it leaves
the server unchanged and prints the install commands in the order to run them before retrying
the restore.

UrbeStack imports server.json, restores every customer archive in full and rebuilds once at the
end. --trust-files is the only option you can combine with --server. As with a server profile
import at the shell, it authorizes restoring the hooks, overrides and registered files the
profile carries. The new installation keeps its hostname, IP addresses and DNS identity.
Certificate renewal issues new certificates once DNS points to this server, and the license
moves to the new IP address.

Options

Find other commands that accept these options

Same in the API

These operations run the command.

Command family: restore

1 commandView all commands in this family →
urbestack-
Generated from release 0.2.35 (current) · urbestack-restore --help outputThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/commands/urbestack-restore/