Skip to main content

Migrating from WordPress Multisite to WordPress Multitenancy

Migrating from Multisite (WPMU) to Multitenancy (WPMT) is a delicate process. This is a very specific process that must be followed exactly to make sure nothing goes wrong. Whenever possible, we will use wp-cli to keep things as efficient as possible.

Prepare a Staging Area

1. Check DNS Records

Check the DNS records in Cloudflare to make sure you have access to the client's DNS and that they have _acme-challenge records in place for SSL certification.

2. Build a Staging Site on a Development Server in GridPane

https://my.gridpane.com/sites

  • Server: development
  • System User: Autocreate new user
  • WP Users: GridPane Default WP Admin Only
  • Bundles: None
  • PHP Version: 7.4
  • PHP Process Management: Dynamic
  • Server Caching: Redis Object & Page
  • WAF: 7G
  • SMTP Integration: Sendgrid
  • SSL: AutoSSL
  • DNS API Integration: Cloudflare
  • Local Backups: Daily
  • Remote Backups: Weekly
  • Git Integration: digitalchurch-wordpress
  • Git Branch: main

Migrate the Database using All-in-One WP Migration

1. Put the source multisite site in Multisite Maintenance Mode

The wp-cli command below will activate the Multisite Maintenance Mode plugin. Be sure to replace the {{site.url}} with the domain of the site you are moving.

gp wp digitalchurch.app plugin activate multisite-maintenance-mode --url={{site.url}}

2. Disable the CDN Rewriting from Perfmatters

Visit Dashboard > Settings > Perfmatters > CDN and disable the CDN retwriting.

3. Use WP All-in-One Migration to backup site

Visit the network export page here: https://digitalchurch.app/wp-admin/network/admin.php?page=ai1wm_export

Be sure to use the following settings to exclude all files from the export:

❌ Protect this backup with a password
❌ Do not export spam comments
❌ Do not export post revisions
✅ Do not export media library (files)
✅ Do not export themes (files)
✅ Do not export inactive themes (files)
✅ Do not export must-use plugins (files)
✅ Do not export plugins (files)
✅ Do not export inactive plugins (files)
✅ Do not export cache (files)
❌ Do not export database (sql)
❌ Do not replace email domain (sql)
❌ Do not include the selected files new No files selected
❌ Do not include the selected database tables new

It's best to use the dashbaord UI for this so you can see if it gets stuck for any reason, but if you need to use wp-cli, you can use the command below.

gp wp digitalchurch.app ai1wm backup --exclude-inactive-themes --exclude-muplugins --exclude-plugins --exclude-inactive-plugins --exclude-cache --sites={{site.url}}

4. Prepare the Staging Area

Activate All-in-One WP Migration & Prep Directories

gp wp {{site.url}} plugin activate all-in-one-wp-migration;
gp wp {{site.url}} plugin activate all-in-one-wp-migration-multisite-extension;
mkdir ~/www/{{site.url}}/htdocs/wp-content/ai1wm-backups/;
chmod 0777 ~/www/{{site.url}}/htdocs/wp-content/ai1wm-backups/;
chmod 0777 ~/www/{{site.url}}/htdocs/wp-content/plugins/all-in-one-wp-migration/storage/

5. Move the backup to the new single site install

Move the backup file to the new single site install via FTP.

6. Restore the backup into the single Installation

Login to the staging site by changing your hosts file. Restore the backup. Alternatively, you can use the commands below to restore via SSH.

gp wp {{site.url}} ai1wm list-backups
gp wp {{site.url}} ai1wm list-backups

Then copy the backup name and restore it with this command.

gp wp {{site.url}} ai1wm restore {{backup-name}}
gp wp {{site.url}} ai1wm restore {{backup-name}}

Migrate the Files via GoodSync

1. Setup a GoodSync job

Sync all files from the /wp-content/uploads/sites/{{id}}/ directory on the multisite to the /wp-content/uploads/ directory on the staging installation.

2. Exclude folders that contain cache or unused files.

Only include the upload directories that are year numbers.

Complete staging the new installation

1. Change your hosts file to check the site and finish setup.

Clear the Builder Cache and Page Cache.

gp wp {{site.url}} beaver clearcache
gp fix cache {{site.url}}

2. Complete a Plugin Audit

Deactivate all plugins that were only related to migration or multisite management.

  • All-in-One WP Migration
  • All-in-One WP Migration Multisite Extension
  • Astra Pro (or Kadence Pro)
  • Customizer Import/Export
  • oEmbed Plus
  • Unconfirmed
  • User Switching
  • WP Crontrol

Activate Fluent SMTP

3. Edit Plugin Settings

  • Go to Settings > Beaver Builder and set up the white labeling. /wp-content/mu-plugins/admin/assets/DigitalChurchFavicon.svg
  • Setup SMTP via Postmark
  • Enter License Keys for all plugins that have notices

4. Setup Fluent SMTP

Make sure to add the domain as a signature domain in Postmark here: https://account.postmarkapp.com/signature_domains

5. Check Plugin Consistency Between Source and WPMT Repo

note

This should only need done for each multisite installation once to make sure all plugins and themes are consistent between the multisite and the WPMT repo.

Run this command on the source multisite to see what plugins are active on that site.

gp wp digitalchurch.app plugin list --status=active,active-network --format=csv --fields=name --url={{site.url}}

Then run this command on the multitenant install to see if the activate the same plugins.

gp wp {{site.url}} plugin activate {{paste-list-here}}

Tip: You can use AI to build the new command like this:

can you write a gridpane wp-cli command like this, but adding in the list of plugins I need to paste? The site.url is sconaz.org
gp wp {{site.url}} plugin activate {{space-separated-list-here}}

Clone from Staging to WPMT

1. Initiate GP Clone

In GridPane, access the single installation site editor. In the clone tab, clone the site to the WPMT server closest to the client. You can watch the clone progress using the GP Clone Log from the source staging site.

2. Change the DNS and Issue an SSL Certificate if needed

3. Make sure WP Memory Limit is set to 512

4. Update Airtable to Put Workspace on the Correct Server