Amanur Rahman Backup & Restore

By Md Amanur Rahman

0+ active installationsVersion 2.2.0

Back up your whole WordPress site — database and files — into one .zip, then restore or move it with one click. Built for large sites.

Description

Backup, restore and move a WordPress site without touching the command line

Amanur Rahman Backup & Restore packs your database and your wp-content folder (uploads, themes, plugins) into a single .zip file. Restore that file on the same site, or on a new host, a staging copy or a new domain, and the site comes back as it was. Work is done in many small steps, so big sites are not stopped by your host’s script time limit.

Free vs. paid, plainly:

  • Free: create backups of any size, download them, delete them, and restore backups up to 500 MB. Both ways of restoring work — upload a .zip in the browser, or copy it into the backups folder by FTP and restore from the list.
  • Paid add-on: the separate Unlimited Restore add-on removes the 500 MB restore limit. Install it next to this plugin and backups of any size can be restored.

The limit applies to restoring only. You see it on the Restore screen before you start, not after you have made a backup. If your site’s backups are bigger than 500 MB, check this before you rely on the free version.

Why use it?

  • One-click backup: database and wp-content into one .zip, with an option to leave out cache folders
  • One-click restore: from an uploaded file or from a backup already in the list
  • Made for large sites: archives above 4 GB are handled (ZIP64), big files and big database tables are processed in pieces, and progress is saved on the server
  • Safe to interrupt: lose your connection or close the tab and press “Try Now” to continue from where it stopped — nothing starts over
  • Moves sites between addresses: restoring onto a different domain rewrites the old address everywhere in the database, including serialized settings, without corrupting them
  • The live site is not left half-restored: the database is loaded into side tables first and switched in at the very end
  • Plain explanations when something fails: real errors with the file, line and table, a check of the restored site, and exact messages for missing files, a full disk or an expired login

How to move a site — 1-2-3:

  1. Install the plugin on the old site and on the new one
  2. Create a backup on the old site and download the .zip
  3. Restore it on the new site: upload the .zip, or copy it to the backups folder by FTP and press Restore

For developers:

  • Filters: ocwpbr_restore_size_limit (restore limit in bytes, 0 = unlimited), ocwpbr_exclude_paths (leave paths out of backups), ocwpbr_rewrite_urls (turn the address rewrite off), ocwpbr_url_step_seconds
  • Action: ocwpbr_loaded — add-ons hook in here instead of editing core files
  • Add-ons can add their own classes in includes/pro/

What this plugin does not do (yet): scheduled backups, cloud storage (Dropbox, Google Drive and similar), multisite networks, WP-CLI commands. Back up before you restore, and keep a copy off the server.

Compatibility: WordPress 6.2 or newer, PHP 7.2 or newer. Works with MySQL and MariaDB, including converting MySQL 8 collations for MariaDB and different table prefixes.

Support and contact:

Privacy: the plugin collects no personal data and sends nothing to the author or to any third party. The only network request it makes is to your own site’s address, after a restore, to check that the restored site loads.

Installation

  1. In WordPress go to Plugins > Add New, search for “Amanur Rahman Backup & Restore”, then Install and Activate.
  2. Or upload the amanur-rahman-backup-restore folder to /wp-content/plugins/ and activate it on the Plugins screen.
  3. Open Backup & Restore in the admin menu and press Create Backup.
  4. To use the Unlimited Restore add-on, install and activate it as well.

FAQ

Is there a backup size limit?

Not for creating backups — the ceiling is your own server’s disk space. The free version can restore backups up to 500 MB. To restore larger ones, install the Unlimited Restore add-on.

Is restoring free?

Yes, up to 500 MB. Upload the .zip on the Restore screen, or restore a backup already shown in the list. Above 500 MB you need the add-on.

My backup is bigger than 500 MB. What now?

Your backup is safe and you can still download it. To restore it, install the Unlimited Restore add-on. Nothing needs to be changed in the backup itself.

My host limits upload size. Does that stop me?

Not for the .zip itself: the browser upload is sent in 2 MB pieces, so the total size is not limited by upload_max_filesize. If the browser upload still fails on your host, copy the .zip into the backups folder by FTP (the path is shown on the Backups screen), and restore from the list.

How do I move my site to a new host or domain?

Install the plugin on both sites. On the old site create a backup and download it. On the new site (a fresh WordPress is enough), upload the .zip on the Restore screen. If the address is different, the old address is replaced with the new one automatically, including in serialized data. File-system paths stored in the database (for example /www/wwwroot/example.com/...) are not rewritten. Afterwards, save Settings > Permalinks once and clear any caches.

Where are my backups stored?

In wp-content/uploads/amanur-rahman-backup-restore/backups/, in a folder that is blocked from direct web access. Download them with the Download button.

Does restoring overwrite my current site?

Yes. Restoring replaces your current database and wp-content files with the backup. Create a fresh backup of the current site first.

What does a backup include?

The whole database and the wp-content folder (uploads, themes, plugins). WordPress core files and wp-config.php are not included. Earlier backups are never put inside a new backup.

What if the backup or restore stops half-way?

Press Try Now. The position is saved on the server and the job continues from there. After a page reload the unfinished job appears under “In progress” on the Backups screen.

Why did the restore page log me out?

A restore replaces the users table, so your login may no longer be valid. Reload the page and log in again with the account from the backup.

Does it work with multisite, or back up to the cloud?

Not at the moment. It is built for single WordPress sites and stores backups on the server, where you can download them.

What security measures does this plugin take?

  • Every action needs the manage_options capability and a valid nonce.
  • The storage folder, and every working folder, is blocked from direct web access and PHP execution (.htaccess, index.php and web.config).
  • File names are resolved with realpath() and confined to the plugin’s own folder before any read, download or delete.
  • Archive entries are checked before extraction to stop path traversal (“zip slip”).
  • Uploaded files are checked by extension and by file signature.

If you find a security issue, please report it privately to the author.

Changelog

2.2.0

  • Added: the free version restores backups up to 500 MB. Larger backups can be restored with the separate “Unlimited Restore” add-on. Creating, downloading and deleting backups is not limited.
  • Added: the Restore and Backups screens show the limit, and a backup over the limit shows an “add-on needed” link instead of a Restore button that would fail.
  • Added: the ocwpbr_restore_size_limit filter, which add-ons use to change the restore limit (0 = unlimited).
  • Improved: readme rewritten — what is free and what the add-on adds is now stated plainly.

2.1.3

  • Fixed: downloading a large backup could fail with HTTP 500. If a caching/security/optimisation plugin keeps an output buffer open (many do, on every request), the whole backup was copied into PHP memory before sending and hit memory_limit. Output buffers are now closed first and the file is streamed in 1 MB pieces with the time limit lifted.
  • Added: interrupted downloads can be resumed (HTTP Range), which also works through proxies such as Cloudflare.
  • Fixed: a missing backup file was reported as HTTP 500 “File not found.” It now answers 404 and says what is wrong (no such file / not readable / outside the backups folder) and which path was checked.

2.1.2

  • Fixed: ‘Class “OCWPBR_Zip_Writer” not found’ (or any other plugin class) on a site where some plugin files are missing — an interrupted upload, a partial FTP copy, or a hosting malware scanner removing files. The plugin now checks its own files: an admin notice and every backup/restore request name exactly which files are missing and what to do. An incomplete install can no longer take the whole site down, and the restore still works if only its optional helper files (safe mode, site-address rewrite) are missing.

2.1.1

  • Fixed: a backup could fail right at the start (0%) with only “Connection interrupted” and no reason. Every failed request now says why: the HTTP status and the start of the server’s reply, a PHP error printed into the reply, a timeout, or no response.
  • Fixed: a lost login session (it expires, or a restore replaces the users table and logs everyone out) looked like a connection problem, and “Try Now” could never fix it. It now says so and offers “Reload page”.
  • Fixed: a PHP warning or notice printed in front of an otherwise correct reply made the browser report failure although the server had done the work. The reply is now read anyway.
  • Fixed: scratch folders of failed, cancelled or abandoned backups and restores (several GB each) were never deleted and could fill the disk until every new backup failed at once. They are removed when a backup starts and by the daily cleanup; folders of jobs that can still be resumed are kept.
  • Added: before a backup starts the free disk space is checked, and the real numbers are shown if there is not enough room.

2.1.0

  • Added: the site address is rewritten automatically when a backup is restored onto a different address (for example a copy of https://example.com restored on https://stg.example.com). Before this, the restored site redirected back to the backup’s address. The old address is replaced with this site’s address in every table — including serialized data (string lengths are kept correct), JSON-escaped and URL-encoded forms, and protocol-relative links. Post GUIDs are never changed, a different domain that merely starts with the old one is left alone, and values that cannot be rewritten safely are left untouched and reported. The rewrite happens on the restored copy before it is switched in, so the live site is never touched until the end. Use the ocwpbr_rewrite_urls filter to turn it off.
  • Note: file-system paths stored in the database (for example /www/wwwroot/example.com/…) are not rewritten.

2.0.0

A major reliability release: backups and restores now work on large sites and restore a site exactly as it was.

Backup
* New append-only archive writer. Every step costs the same no matter how big the archive already is, so large backups no longer stall at the same percentage. Big files are streamed across several steps and ZIP64 is used automatically above 4 GB.
* Large database tables are exported with keyset pagination, so a huge table no longer outlasts the server’s time limit. A step that was cut off can no longer leave duplicate rows in the dump.
* Earlier backups are reliably left out of new backups (exact folder matching, Windows-safe paths, any finished *.backup.zip is skipped) so backup size no longer grows every time.
* Fixed: every “%” in the database was written to the dump as a random “{hash}”, which broke serialized theme/plugin settings and permalinks on restore.
* A full disk or small temp folder is reported clearly instead of silently producing a damaged archive.

Restore
* Fixed: each restore step silently dropped the multi-row INSERT it stopped in the middle of (up to 500 rows). Steps now only stop between statements. Backups made by older versions are repaired automatically while restoring.
* The restored database is first loaded into side tables and switched in all at once, as the very last step, after the files are in place. The live site is never left half-restored.
* Every database query and file copy is checked. Real MySQL errors are shown with the table name, unsupported collations (MySQL 8 to MariaDB) and different table prefixes are converted.
* Safe mode: while a restore runs, this plugin’s own AJAX requests load only this plugin (a temporary mu-plugin, removed afterwards), so half-copied plugins or themes cannot crash the restore with HTTP 500.
* wp-content drop-ins (object-cache.php, advanced-cache.php, db.php …) are copied last. Object cache and opcode cache are flushed after the switch.
* Cancelling a restore removes its side tables and scratch files.

Notices and errors
* “Please review these notices” panel: after a restore the site is checked and any PHP error it produces (message, file, line), missing active-plugin files, a broken theme, or a redirect to another address is listed on screen. A PHP fatal error that stops a step is shown with its file and line.
* “Try Now” always appears after an interruption and continues from the saved position. Requests time out instead of hanging, steps are locked per job, and “Try Now” also fires when the connection returns. Interrupted jobs can be resumed after a page reload.
* Progress bar: the percentage is readable at every value, and the bar turns green on success and red on error.

Other
* Deleting the plugin now removes its jobs folder completely, including the temporary safe-mode file.
* Note: a backup or restore that was started with an older version cannot be continued. Press Cancel and start a new one. Existing backup files keep working.

1.4.3

  • If the internet connection drops during a backup, restore or upload, a “Try Now” button appears and continues from where it stopped instead of starting over.
  • The progress bar now shows the completed percentage.
  • Retried upload chunks are no longer appended twice.

1.4.2

  • Removed an unnecessary conditional require of a wp-admin core file.
  • Working files for an in-progress backup/restore (the raw database dump and the raw extracted files) now live outside the web-accessible document root instead of under wp-content/uploads, in addition to the existing folder lock-down.

1.4.1

  • Renamed the plugin (display name and slug) to be more distinctive.
  • Removed the free/premium backup-size cap — the plugin is fully functional with no locked or restricted features.
  • Hardened the folder an uploaded archive is extracted into against direct web access/execution.
  • Fixed a SQL LIKE pattern in uninstall.php so it can no longer match unrelated option names.

1.0.0

  • Initial release: full-site backup, restore, and progress tracking.