Unarchiver

A powerful, single-file PHP script designed for unpacking backups. Companion script for the Archiver.

TAG ×

Archive Restorer (Migration Tool)

Version PHP License

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 wget and curl), avoiding the need to download/upload to your local machine first.
  • ๐Ÿ“‚ Structure Fixer: Detects if files were extracted into a nested subfolder (like httpdocs or public_html) and moves them to the root automatically.
  • ๐Ÿ—„๏ธ Database Import:
    • Scans for .sql or .sql.gz files.
    • Accepts database credentials via UI.
    • Imports directly using the system mysql command for speed.
    • Plesk Helper: Includes a JS snippet to auto-fill database credentials in the Plesk interface.
  • โš™๏ธ Config Automator: Automatically updates wp-config.php with the new database credentials.
  • ๐Ÿ”— Path Fixer: Scans .htaccess, .user.ini, and wp-config.php to 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:

  1. PHP 7.4 or higher.
  2. shell_exec and exec enabled (Required for unzip, tar, and mysql commands).
  3. Write permissions on the directory where the script is uploaded.
  4. 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: