Agentic UI: Add backup import to the site overview - #4500
Conversation
📊 Performance Test ResultsComparing 4ba390e vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
katinthehatsite
left a comment
There was a problem hiding this comment.
I see that: apps/ui/src/data/queries/use-import-site.ts file has the following comment:
/**
- Runs a backup import against a site that has just been created. The
- The cached site list is invalidated so metadata changed by the importer is
- picked up.
*/
We should probably adjust it since we are now using the hook not only for the newly created site.
|
Generally, it works well but I noticed that i can duplicate a site while it is importing, should we disable the duplication in that case? |
Yes, I think we should disable it |
…entic-ui' into stu-2008-add-import-export-to-agentic-ui
Sounds good 👍 |
katinthehatsite
left a comment
There was a problem hiding this comment.
The import itself worked well for me but I noticed that I am having a hard time reaching the Overview tab of another site while the import is in progress. I tried to capture it in the screencast below:
Screen.Recording.2026-08-12.at.9.33.04.AM.mov
Do you see something similar?
| description={ __( | ||
| 'Importing a backup will replace the existing files and database for your site.' | ||
| ) } | ||
| confirmButtonText={ __( 'Import' ) } |
|
Thanks for the review @katinthehatsite! Both of your findings are fixed:
Also changed while in here:
Can you take another look, please? 🙇 |
| } ) ); | ||
|
|
||
| vi.mock( '@/data/queries/use-sites', () => ( { | ||
| // The real `useImportSite` invalidates this key on success. |
There was a problem hiding this comment.
I think we can drop this comment, it seems self-explanatory
| useOffline: vi.fn(), | ||
| } ) ); | ||
|
|
||
| // Real store elsewhere — the pending/success entries drive the button states |
There was a problem hiding this comment.
Can also be cleaned up as the pattern is evident from the code
| ); | ||
| await waitFor( () => expect( emitProgress ).toBeDefined() ); | ||
|
|
||
| // 500 chunks spanning two whole-percent steps of the same 10-file backup. |
There was a problem hiding this comment.
It seems that this just descibes what the loop does so I would drop it as well
…export-to-agentic-ui # Conflicts: # apps/ui/src/components/site-dropdown/main-view.tsx # apps/ui/src/components/site-overview-view/index.test.tsx # apps/ui/src/hooks/use-site-management-actions.ts


Related issues
How AI was used in this PR
Claude Code wrote the implementation and tests. I reviewed the diff and verified the behaviour in the browser (both themes) before pushing.
Proposed Changes
Import was only reachable in the Agentic UI while creating a site, so there was no way to restore a backup over a site you already had — you had to start site creation over. Export already lived in the site overview; import now sits beside it.
Picking a backup asks for confirmation before overwriting, then reports progress, success, and failure. Import and export block each other while either is running, matching Classic.
Also brings site creation in line with Classic on
.sql: a database dump has no files to go with it, so it can only be imported over an existing site, not used to create one. The Agentic onboarding card accepted.sqland nothing downstream rejected it, so it would create a site from bundled WordPress files and apply a dump whose themes and plugins were missing from disk.Testing Instructions
.txt) — it should be rejected before the confirmation appears..sqlfile should now be rejected; a.zip/.tar.gzshould still go through.Pre-merge Checklist