Unarchiver
A powerful, single-file PHP script designed for unpacking backups. Companion script for the Archiver.
Archive Restorer (Migration Tool)
A powerful, single-file PHP script designed to automate the migration and restoration of WordPress websites (and other PHP applications). Originally optimized for Cloud86 hosting, but compatible with most Linux/Apache/Nginx environments running cPanel, Plesk, or DirectAdmin.
๐ Features
This tool handles the entire migration workflow in a step-by-step wizard interface:
- ๐ฆ Smart Extraction: Automatically detects and extracts
.zip,.tar,.tar.gz, and multi-part archives (e.g.,.part1.zip,.z01). - ๐ฅ Remote Import: Pull backups directly from another server using a URL (supports
wgetandcurl), avoiding the need to download/upload to your local machine first. - ๐ Structure Fixer: Detects if files were extracted into a nested subfolder (like
httpdocsorpublic_html) and moves them to the root automatically. - ๐๏ธ Database Import:
- Scans for
.sqlor.sql.gzfiles. - Accepts database credentials via UI.
- Imports directly using the system
mysqlcommand for speed. - Plesk Helper: Includes a JS snippet to auto-fill database credentials in the Plesk interface.
- Scans for
- โ๏ธ Config Automator: Automatically updates
wp-config.phpwith the new database credentials. - ๐ Path Fixer: Scans
.htaccess,.user.ini, andwp-config.phpto replace old absolute paths with the current server path. - ๐งน Cleanup: One-click removal of the script and all archive files after migration is complete.
๐ Prerequisites
To run this script, your hosting environment needs:
- PHP 7.4 or higher.
shell_execandexecenabled (Required forunzip,tar, andmysqlcommands).- Write permissions on the directory where the script is uploaded.
- Standard system tools installed:
unzip,tar,mysql,wget(optional),curl(optional).
๐ ๏ธ Installation & Usage
1. Upload the Script
Upload the restore.php (or whatever you name this script) to the root directory of your website (e.g., /public_html/ or /httpdocs/).
2. Upload Archives (Two Options)
- Option A (FTP): Upload your backup zip/tar files to the same folder via FTP/SFTP.
- Option B (Remote): Open the script in your browser and use the "Remote Import" feature to pull files from a direct URL.
3. Run the Wizard
Navigate to the script in your browser:
Changelog
[1.1.0] 17-02-2026
- Improvement Server-Side Retry Logic: Added a retry loop and aggressive cache clearing to fix race conditions when scanning for databases after moving files.
- Improvement Path Scanner Upgrade: Now detects and fixes directory paths (e.g., WPCACHEHOME) in wp-config.php, not just file paths.
- Improvement WAF Support: Added specific logic to detect and fix paths in wordfence-waf.php, handling complex regex patterns found in .user.ini and .htaccess.
- Improvement Database Scan Logic: Refined exclusion logic to use relative paths, preventing false positives when the site is located in a system path (e.g., /var/www/).
- Improvement Backup Inclusion: Re-enabled scanning of backups/, _backups/, etc., ensuring valid SQL dumps in these common locations are found.
- Improvement Fast Path Scan: Added a "fast path" check using glob() to instantly find SQL files in the root directory.
- Improvement Import Fallback: Implemented automatic fallback to synchronous import if the background (async) import process fails.
- Fix False Positive Reduction: Fixed an issue where system directories (like administrator in Joomla or vendor in Magento) caused thousands of irrelevant SQL files to be detected.
- Fix 500 Error Prevention: Added automatic sanitization of .htaccess files immediately after moving them. This specifically comments out "cPanel-generated PHP handlers" (AddHandler directives) that cause 500 Internal Server Errors on Cloud86 hosting.
- Fix Cleanup Limits: Limited the recursion depth of the cleanup process to 3 levels to prevent timeouts and improved the regex for identifying .imported SQL files.
[1.0.1] - 03-02-2026
- Improvement When pulling a remote file the progress is now shown as a single line instead of new log entries.
[1.0.0] - 02-02-2026
- New Major Release: First stable release of the Archive Restorer tool.
- Feature Remote Fetching: Integrated a remote import module supporting
wgetandcurlwith real-time download progress tracking and split-part detection. - Feature Smart Unpacking: Support for
.zip,.tar, and.tar.gzusing system-level commands andnohupto bypass PHP execution timeouts. - Feature Structure Normalization: Added an automatic detection system for nested folder structures (e.g.,
public_htmlorhttpdocs) with a one-click move-to-root utility. - Feature Database Suite: - Added a recursive SQL scanner for
.sqland.sql.gzfiles.- Plesk Smart-Bot: Created a JavaScript console-injection snippet to automate the creation of databases and users within Plesk.
- Automated
wp-config.phpupdating after successful database imports.
.htaccess and wp-config.php.- Wordfence Recovery: Added specific logic to automatically repair
wordfence-waf.phppathing to prevent 500 errors post-migration.
0755 for directories and 0644 for files.node_modules, vendor, and backups.