Complete restore can leave the site half-restored

Open
#247 0 comments 0 reactions 0 assignees View on GitHub

@rafaelmaeuer is already working on this.

Since Oct 29, 2026.

  • #251 by @rafaelmaeuer — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
20/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
php, wordpress
Domain
backend, devtools

Research direction

The issue describes restore behavior in the file-copy and EventSource request paths, but names no source files or tests. Read the restore implementation and inspect the open pull request #251 to understand the proposed fix. Done means the running BackWPup version remains in place and the copy finishes after the browser leaves the page.

Written by the indexing model from the issue text.

Description

Describe the bug
Two ways a complete restore leaves a mix of old and restored files:

  1. The backup's BackWPup replaces the running plugin. The file step copies wp-content/plugins/backwpup from the backup over the plugin running the restore. The database step and the cleanup then run the backup's (often older) code, so fixes in the installed version are not used.
  2. Leaving the restore page aborts the copy. The file copy runs in one EventSource request without ignore_user_abort. Following a link, closing the tab or dismissing an admin notice via its link makes PHP abort the copy halfway.

To Reproduce

  1. Install a newer BackWPup than the one in the backup and start a complete restore. After the file step, wp-content/plugins/backwpup/backwpup.php has the backup's version.
  2. On a site with All-In-One WP Security's firewall (loaded via auto_prepend_file), restore a backup containing a different AIOS version and leave the page while "Restoring: Directories" is running.

Observed
For case 2, the restore log stops mid-way and every request, including / and the restore page, fails with:

PHP Fatal error: Trait "AIOWPS\Firewall\File_Prefix_Trait" not found

AIOS' new config.php was copied, but the libs/traits/ folder it needs was still queued. The restore can't be resumed from the browser.

Expected behavior
The restore keeps the running BackWPup plugin and finishes the copy even if the browser leaves the page.

System

  • BackWPup 5.7.8 (restore code shared with 4.x)
  • PHP 8.3, MariaDB, All-In-One WP Security with firewall enabled

A fix is ready as a pull request.

Dominant language
PHP
Stars
96
Forks
48
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wp-media/backwpup

All issues in wp-media/backwpup

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.