Archiver
A powerful, single-file PHP script designed for creating reliable backups and seamless migrations.
Archive Creator
A powerful, single-file PHP script designed for creating reliable backups and seamless migrations on any web server. It's engineered to overcome common hosting limitations and provide a stable, user-friendly experience.
🎞️ A quick demo

📚 Table of Contents
- Designed for Universal Compatibility
- The PHP Engine: The Recommended Choice
- How It Works: A Smart Fallback System
- Quick Start Guide
- FAQ & Troubleshooting
- Security First
🌍 Designed for Universal Compatibility
A core design principle of this script is that it must work everywhere. Many backup tools fail on shared hosting due to strict server limits. This script is engineered to bypass these issues through:
- Single-File Architecture: The entire application is one file. No installation is needed. Just upload and run.
- Zero External Dependencies: The script does not rely on external libraries or frameworks, minimizing the risk of conflicts.
- Dual-Engine Architecture:
- System Engine: Uses the server's native commands (
zip,tar) for maximum speed and efficiency. - PHP Engine: If the System Engine is unavailable (e.g., the
exec()function is disabled), the script defaults to its built-in PHP methods. These are more universal, albeit slightly slower.
- System Engine: Uses the server's native commands (
- Asynchronous Processing: To prevent PHP timeouts, the PHP Engine processes files in small, JavaScript-driven batches. This allows the script to run for hours on servers with an execution time limit of just 30 seconds.
⭐ The PHP Engine: The Recommended Choice
For maximum compatibility and reliability across the widest range of hosting environments, the PHP Engine is the strongly recommended choice.
While the script offers a faster "System Engine," the PHP Engine is designed from the ground up to be resilient and feature-rich.
| Why You Should Use the PHP Engine |
|---|
| Universal Compatibility |
| Timeout-Proof Architecture |
| Full Feature Set |
When should I use the System Engine? The System Engine is a high-performance option for advanced users on servers where
exec()is enabled. It's faster but offers less compatibility and does not perform the migration-specific cleaning tasks. When in doubt, use the PHP Engine.
⚙️ How It Works: A Smart Fallback System
The script is built to be "self-healing." It always attempts to use the most efficient method available and seamlessly falls back to a more compatible alternative if the primary method fails. This layered approach ensures the process always completes.
| Operation | Primary Method (Performance) | Fallback Method (Reliability) |
|---|---|---|
| Archiving | System Engine (via exec() with zip or tar). Blazing fast and memory-efficient. |
PHP Engine (built-in ZipArchive / PharData). Works in batches to ensure completion. |
| Database Backup | mysqldump command-line. The industry standard for fast, complete database exports. |
Pure PHP Method. Streams the database row-by-row to avoid memory limits and timeouts. |
| Session Handling | Standard PHP file-based sessions. The default, efficient method for tracking state. | Database-based sessions. If file sessions fail, it uses the WordPress database to store its state. |
| File Scanning | RecursiveDirectoryIterator. A modern and fast PHP iterator for traversing directories. |
scandir(). A more basic, but universally supported function for reading directory contents. |
🚀 Quick Start Guide
- 1️⃣ Upload: Place the single
creator.phpfile in your website's root directory. - 2️⃣ Navigate: Open the script in your browser (e.g.,
https://yourdomain.com/creator.php). - 3️⃣ Select & Configure:
- Select the files and folders you want to archive.
- Choose the PHP Engine (recommended).
- For WordPress sites, check "Backup Database" in Step 3.
- 4️⃣ Start: Click "Start Archiving" and monitor the real-time progress.
- 5️⃣ Download & Clean Up: Once finished, download your archive(s) from the results screen.
⚠️ CRITICAL FINAL STEP After you have safely downloaded your files, click the "Delete Archives and Script" button. This securely removes all generated files and the script itself from your server. Never leave this script on a live website.
❓ FAQ & Troubleshooting
Q: The process times out or I get a "500 Server Error." What should I do?
A: This is the exact problem the PHP Engine is designed to solve.
Solution: Ensure you are using the PHP Engine and try lowering the "Files per batch" value in Step 2 (e.g., to 250 or 100).
Q: The "System Engine" option is disabled.
A: The exec() function is disabled in your server's PHP configuration.
Solution: This is expected on many shared hosts. Use the PHP Engine, which is the recommended method anyway.
Q: I can't create a .tar.gz archive.
A: The PHP Phar extension is not enabled or is set to read-only on your server.
Solution: Use the .zip format instead. This format is universally compatible and supports file splitting.
Q: The remote connection test (FTP/SFTP) fails. A: This is usually caused by a firewall on the source server (where the script is running) blocking outgoing connections. Solution: Double-check your credentials. If they are correct, contact your hosting provider to ensure outgoing connections on the specified port are allowed.
🔒 Security First
This script is a powerful server tool and must be handled with care.
- DELETE AFTER USE: The most important rule. Use the cleanup button after downloading your files.
- PROTECTED DIRECTORY: Archives are stored in a
specificfolder, which is automatically protected from direct web access via a.htaccessfile. - SECURE DOWNLOADS: The download handler is built to prevent directory traversal attacks, ensuring only files from within the protected backup folder can be accessed.
Changelog
[2.8.5] - 17-02-2026
- Feature Added "Smart Memory Limiter" to the archiving core. This proactively checks memory usage during the archiving process and gracefully stops the current batch if usage exceeds 90% of the PHP memory limit. This prevents "Allowed memory size exhausted" fatal errors, ensuring stability on constrained hosting environments.
- Improvement Added a better file scanner with better logging so when a file or folder fails in the initial scan the folder is still skipped but now it is also logged. Instead of skipping the whole folder the next file in the folder is processed.
- Improvement Enhanced client-side handleFetch to intelligently parse JSON responses, ignoring non-JSON prefixes (e.g., PHP warnings or server notices).
- Improvement Hardened handle_transfer_file and handle_verify_archive to prevent crashes when encountering invalid UTF-8 characters in filenames.
- Fix Resolved JSON corruption issue by removing legacy keep-alive heartbeat.)
- Fix Resolved JSON Parse Error during scanning and archiving by implementing strict output buffer cleaning (ob_clean) and robust JSON encoding.
-
[Fix] Fixed "Server response was invalid" errors during remote transfers by disabling the legacy heartbeat mechanism that corrupted JSON output.
[2.8.4] - 12-02-2026
- Fix Improved database encoding handling to prevent character corruption (e.g., "’" issues)
[2.8.3] - 11-02-2026
- Improvement Added a config variable to enable excluding of folders within the /wp-content/uploads/ folder. The exclusions are also visible within the filetree. Backupwp folder is added.
- Improvement Support for config.php and configuration.php files. Updated the UI to reflect those changes.
- Improvement Change DB collation during database export to change tables to utf8mb4_general_ci. Source DB will remain untouched.
- Improvement Updated FTP connection handling to support the transition from "resources" to "objects" introduced in PHP 8.1. Added is_object() checks to ensure ftp_close() functions correctly across both PHP 7.4 and PHP 8.x.
- Improvement Added .tmb files to the auto exclusions
- Fix Resolved an "undefined variable" error for $htaccess_path in archiver.php. The variable is now properly defined within the log_message function before use to ensure full compatibility with PHP 7.4 and higher.
[2.8.2] - 02-02-2026
- New Added a "Copy path" to each archive at the end screen. This will copy the direct URL to the first archive part so you can paste this into the unarchiver which will then download the archive and each file associated to the archive.
- Improvement To make it possible for the unarchiver to access the files via the direct URL a change has been made to the .htaccess files that is created by the archiver so a specific useragent has access to the files.
- Improvement Made some small changes to the dynamic batch size so it decreased the batch size with smaller steps and increases the batch size earlier.
[2.8.1] - 22-01-2026
- Fix The archiving process no longer terminates fatally if a database connection fails (e.g., Access Denied). It now logs a warning and continues archiving files.
[2.8.0] - 21-01-2026
- New Added a version checker that auto-checks for a new version and displays a notice. A manual check happens when clicking on "Re-check enviroment"
- New Adjused the remote transfer test function so that FTPS is tried first and if that fails unsafe FTP is automatically tested.
- Improvement Codebase Standardization: Standardized codebase by translating remaining Dutch comments to English.
- Improvement Removed redundant comments and cleaned up whitespace. Added new comments for uncomment sections.
[2.7.1] - 18-01-2026
- New Add telemetry trigger to update counter on remote website after a successful migration.
[2.7.0] - 16-01-2026
- Feature Security: Added a ModSecurity bypass module using base64 and reverse string coding to ensure operation on restrictive hosts.
- Feature Stability: Implemented a dedicated shutdown handler to gracefully catch and log fatal errors.
- Improvement Performance: Switched archive process state management to a local JSON file for better persistence and speed.
- Improvement Added encoding for file lists to prevent processing errors during the archive phase.
- Improvement Updated core download logic and general configuration handling in
Archiver.php.
[2.5.0] - 13-01-2026
- Feature Storage: Implemented file-based session storage to replace standard PHP sessions, increasing reliability across different server setups.
- Improvement Optimization: Added dynamic batch size calculation to automatically adjust the archiving workload per run.
- Improvement Introduced a connection keep-alive mechanism to prevent premature timeouts during long processes.
- Improvement Optimized JSON encoding routines with enhanced error handling.
[2.4.0] - 09-01-2026
- Feature Transfer: Added automated retry logic for SFTP transfers to handle intermittent network failures.
- Improvement Security: Refactored the self-destruct system to "Passive Mode" for safer cleanup.
- Improvement Memory: Significantly enhanced memory management for SQL dump generation.
- Improvement Added FTP persistence logic for session storage and improved session path detection/validation.
- Fix Implemented error reporting suppression and buffer clearing to prevent corrupted output in the browser.
[2.3.2] - 16-12-2025
- Feature Reliability: Added local fallback: if remote transfer fails, the file is saved locally to ensure no data is lost.
- Improvement Switched to non-blocking FTP puts (
ftp_nb_put) for smoother data streaming. - Improvement Refined configuration file logic and improved FTP fallback mechanisms.
[2.2.x] - 10-12-2025
- Fix v2.2.2: Automatically exclude
node_modulesfolders from the archiving process. - Fix v2.2.1: Decreased files-per-run defaults to ensure stability on low-resource shared hosting.
- Improvement v2.2.0: Process no longer stops if a database export error occurs, allowing file archiving to continue.
[2.1.0] - 08-12-2025
- Improvement UI Update: Major overhaul of the user interface for better clarity and ease of use.
[2.0.0] - 30-11-2025
- New Major Release: Comprehensive update to core logic and server compatibility.
- Feature Smart Fallback: Added a PHP-based MySQL dump engine that triggers automatically if native
mysqldumpis unavailable. - Feature Auto-Detect: Implementation of automatic protocol testing (tests FTPS first, then falls back to FTP).
- Feature Remote Logging: Added a debugging module to send archiver logs to a remote destination.
- Improvement Dropped support for PHP 5.5 to adopt modern, secure coding standards.
[1.0.0] - 19-11-2025
- New First stable release of the TeeCode Archiving tool.