Complete restore can leave the site half-restored
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 20/100
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:
- The backup's BackWPup replaces the running plugin. The file step copies
wp-content/plugins/backwpupfrom 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. - 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
- Install a newer BackWPup than the one in the backup and start a complete restore. After the file step,
wp-content/plugins/backwpup/backwpup.phphas the backup's version. - 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wp-media/backwpup
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
S3 backup list times are shifted by the site's UTC offset (timezone offset applied twice)May be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
WordPress XML export: posts have no categories or tags since 5.6.6Possibly taken @rafaelmaeuer claimed this 14 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Complete restore stops after the file step: user is logged out, database is not restoredPossibly taken @rafaelmaeuer claimed this 14 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Database restore loses data when a row is larger than max_allowed_packetPossibly taken @rafaelmaeuer claimed this 14 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
All issues in wp-media/backwpup
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 3 days
-
sync-en
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
[Sync EN] Formatting improvements to "Large Objects (LOBs)" docs (#6056)Possibly taken A pull request linked to this issue is open or already merged. Opensync-en
Difficulty 1/5 Under an hour Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Перевод устарел
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
repo:cms
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
craftcms/cms#20613 · 1 comment ·
Maintainers usually reply within 1 day