feat: Stepped restore engine for large sites (AJAX-based) #62

Closed
opened 2026-06-21 16:50:20 +00:00 by jmiller · 0 comments
Owner

Summary

The current RestoreEngine runs synchronously, which can time out on shared hosting with large backup archives. Add a SteppedRestoreEngine (mirroring the existing SteppedBackupEngine pattern) that breaks restore into AJAX steps:

  1. Extract — extract archive to staging (can be chunked for large archives)
  2. Files — copy files from staging to Joomla root in batches
  3. Database — import SQL statements in batches (e.g., 500 statements per step)
  4. Config — restore configuration.php
  5. Cleanup — remove staging directory

UI

  • Reuse the progress modal pattern from stepped backups
  • Show phase, progress %, and current operation

Why

Sites with 10,000+ files or large databases timeout during synchronous restore on shared hosting (30s/60s PHP execution limits).

Files

  • src/Engine/SteppedRestoreEngine.php (new)
  • src/Controller/AjaxController.php — add restoreInit() and restoreStep() methods
  • tmpl/backups/default.php — update restore modal to use AJAX steps
## Summary The current `RestoreEngine` runs synchronously, which can time out on shared hosting with large backup archives. Add a `SteppedRestoreEngine` (mirroring the existing `SteppedBackupEngine` pattern) that breaks restore into AJAX steps: 1. **Extract** — extract archive to staging (can be chunked for large archives) 2. **Files** — copy files from staging to Joomla root in batches 3. **Database** — import SQL statements in batches (e.g., 500 statements per step) 4. **Config** — restore configuration.php 5. **Cleanup** — remove staging directory ## UI - Reuse the progress modal pattern from stepped backups - Show phase, progress %, and current operation ## Why Sites with 10,000+ files or large databases timeout during synchronous restore on shared hosting (30s/60s PHP execution limits). ## Files - `src/Engine/SteppedRestoreEngine.php` (new) - `src/Controller/AjaxController.php` — add `restoreInit()` and `restoreStep()` methods - `tmpl/backups/default.php` — update restore modal to use AJAX steps
jmiller added the component: enginecomponent: admin labels 2026-06-21 16:50:20 +00:00
Sign in to join this conversation.
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteBackup#62