Skip to content

Export/Import should support single-site WordPress installs #1016

Description

@superdav42

Enhancement

The export functionality should support single-site (non-multisite) WordPress installs. Currently:

  1. The WordPress Sites page integration (setup_wordpress_sites_integration) only works in multisite because it uses network_admin_menu, manage_sites_action_links, etc.
  2. The export form at add_wp_sites_row_actions() line 146 skips the main site: if (is_main_site($blog_id)) return $actions;
  3. The import creates new sites via wp_insert_site() which only works in multisite
  4. The CLI mu-migration commands assume multisite context

For a single-site WordPress install:

  • Export should work by exporting the entire site's database and uploads
  • Import should work by overwriting the current site's database and uploads (with confirmation)
  • The export menu should be accessible from Tools > Export & Import (not just network admin)

Use Cases

  1. Migrating a single WP site TO a multisite network
  2. Creating a backup of a single site
  3. Cloning a single site to another server
  4. Migrating from a single site to Ultimate Multisite

Suggested Implementation

  • Add admin_menu hook (not just network_admin_menu) for single-site installs
  • Remove the is_main_site() skip for single-site context
  • For single-site import, overwrite the existing database tables instead of creating a new site
  • Add a wp wu export / wp wu import CLI command that works in both single and multisite

Files to modify

  • EDIT: inc/site-exporter/class-site-exporter.php:110-132 — add single-site admin menu support
  • EDIT: inc/site-exporter/class-site-exporter.php:143-166 — handle single-site row actions
  • EDIT: inc/site-exporter/mu-migration/includes/commands/class-mu-migration-import.php:460-467 — handle non-multisite import

Severity

Medium — feature gap for single-site users.


aidevops.sh v3.13.11 plugin for OpenCode v1.3.17 with claude-opus-4-6 spent 9m and 19,858 tokens on this as a headless worker.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions