When to reach for bare-metal restore
Use this when there is no working Joomla to restore into: a brand-new server, a wiped host, disaster recovery, or moving to a new provider. The standalone restore script carries everything it needs to stand a site up from nothing - it does not require Joomla, Composer, or any component to already be present.
This guide covers the bare-metal specifics. For the general restore picture - the admin-panel restore, the CLI restore, and how the restore script is delivered beside or inside your archive (the per-destination restore-script mode) - see the Restore & MokonyxRestore article.
What you upload
Put two things in the empty document root: the standalone restore script and your backup archive. For a split / multipart backup, upload every numbered part plus its manifest - the script reassembles and checksum-verifies them transparently before extracting.
The browser wizard
Open the restore script in a browser and it walks you through preflight checks (PHP version and extensions, archive present, writable directory, free disk space), extraction, a database connection test, the database import, writing the configuration, super-admin management, and cleanup. The detailed step-by-step is in the Restore & MokonyxRestore article; below are the two pieces unique to a bare-metal rebuild.
Cross-domain URL rewrite
When you restore to a different domain, every stored copy of the old site URL - in content, menus, modules, and parameter blobs - would otherwise still point at the old address. The restore script fixes this automatically during the configuration step: when the Site URL you enter differs from the backed-up site's recorded URL, it rewrites every stored occurrence of the old URL to the new one across the install's own tables. (For a same-domain restore it is a no-op.)
The rewrite is a self-contained bare-metal port of the component's rewrite core - it uses PDO directly, with no Joomla autoloader - and it is serialized-data-safe:
- PHP-serialized arrays are decoded, replaced, and re-serialized, so the byte-length prefixes are regenerated correctly (never hand-patched, which would corrupt the data).
- Serialized data that carries objects is left untouched, because it cannot be faithfully re-serialized.
- Slash-escaped URLs embedded in JSON parameter blobs are handled too.
The configuration step also writes a fresh secret and normalises the site URL so the new domain is auto-detected. The rewrite is also available as an explicit action (with a dry-run option) if you want to run it on its own.
Boot verification
After the restore, a boot check confirms the rebuilt site can actually come up - without bootstrapping Joomla - by verifying the target database is reachable, the core tables (users and extensions) are present, and the site configuration file is in place. It is advisory: it reports its finding as a final step rather than blocking the restore, so you know immediately whether the site is ready to load.
Headless CLI mode
The same script runs from the shell for scripted or SSH-driven restores, running the identical pipeline - extract, import, configuration rebuild (which also applies the profile's extension exclusions and the URL rewrite), and boot check. A typical invocation:
php restore.php --run --db-host=HOST --db-name=DB --db-user=USER --db-pass=PASS --db-prefix=PREFIX_
- --run is required - it is the explicit "yes, this is a destructive restore into this directory" gate that replaces the wizard's overwrite confirmation.
- Required:
--db-name,--db-user,--db-prefix. The database password can be passed as--db-passor, to keep it out of the process arguments, via theMOKONYXRESTORE_DB_PASSenvironment variable. - Optional:
--db-host(defaults to localhost),--sitename,--live-site(the new site URL, which drives the cross-domain rewrite),--archive(otherwise the newest archive in the directory is auto-selected),--archive-password,--sef,--force-ssl,--cleanup, and--delete-archive.
Run php restore.php --help for the full option list. The CLI driver reports the boot check as its final advisory line.
Notes and caveats
- The standalone extractor runs one-shot (it raises the time limit) rather than in resumable steps - the in-component restore is the stepped path for time-limited shared hosting.
- Always delete the restore script from the server after a successful restore (the cleanup step and
--cleanupdo this for you). - 7z archives require a 7z binary on the host; the script fails with a clear message if it is missing rather than mis-restoring.