Multisite Migration Live to Local

What is the current best method for migrating a live Flywheel multisite to Local and then vice versa?
Thanks!
Nicholas

Hey Lessis,

happy to help here!

As Local doesn’t support allow pulling with the Local Connect feature and a multisite, you’ll have to do the traditional manual approach. However, it’s not to difficult :slight_smile:

So simply follow these steps:

  1. Create a backup and download it (following this article - https://getflywheel.com/wordpress-support/create-backup/)
  2. Drag the downloaded zipped backup on to Local and that should start the typical import process.
  3. Once complete, you need to simply update your multisite settings into the wp-config file.

That’s it. Enjoy your multisite locally!

Just to note, if you then need to move back to from Local to Flywheel, you’ll want to do a manual migration or request a migration via zip upload (which is the zip you get after exporting your site from Local)

I hope this helps clarify things Lessis, but if not please do let us know and we’ll try to help further.

Thanks,
Chris :slight_smile:

Thanks for the help!

I made it through steps 1 & 2, but once installed, the primary domain appears to be showing the secondary site that I added on Flywheel and I’m not able to login to the wp-admin.

Regarding step 3, what exactly needs to be done to update the multisite settings? I added the following line:

define( ‘WP_ALLOW_MULTISITE’, true );

However, I get the same result when viewing the site or trying to login and in the Local app, “Multisite” still says, "No."
Anything else that needs to be done?

Hey @lessis,

good to hear and oh, that sounds like a misconfiguration and maybe I should have explained further however, there are steps here, specifically step 4 that should help resolve this issue for you.

Just use this guide with your local site domain in mind.

Once completed, you should be rocking and rolling.

Cheers,
Chris :slight_smile:

Quick note: if anyone is trying to import a multisite WordPress installation into a Preferred Local site that was not initially configured with multisite, you will need to do the following:

  1. Right-click on the site in Local’s sidebar
  2. Go to “Open Site SSH”
  3. Run the following command:
ln -sf /etc/nginx/global/wordpress-multi.conf /etc/nginx/global/wordpress.conf && killall nginx

For others that have found your way here, Clay’s command was for an older version of the Preferred Environment, and newer versions have a slightly different folder structure.

Here’s the updated process using Clays notes:

  1. Right-click on the site in Local’s sidebar
  2. Go to “Open Site SSH”
  3. Run the following command:
ln -sf /etc/nginx/includes/wordpress-multi.conf /etc/nginx/includes/wordpress.conf
  1. Restart the site so that the NGINX config changes get loaded in

You can verify that things are setup correctly by looking at the folder and seeing the link correctly pointing to the multisite configuration file. Here’s what my terminal output looks like:

root@f10719522f5e:~# ln -sf /etc/nginx/includes/wordpress-multi.conf /etc/nginx/includes/wordpress.conf
root@f10719522f5e:~# ls -alh /etc/nginx/includes/
total 32K
drwxr-xr-x 2 root root 4.0K Nov  6 16:39 .
drwxr-xr-x 4 root root 4.0K Nov  6 16:32 ..
-rw-r--r-- 1 root root  724 Sep 10 20:38 gzip.conf
-rw-r--r-- 1 root root 5.3K Sep 10 20:38 mime-types.conf
-rw-r--r-- 1 root root  746 Sep 10 20:38 restrictions.conf
-rw-r--r-- 1 root root  783 Sep 10 20:38 wordpress-multi.conf
-rw-r--r-- 1 root root  374 Sep 10 20:38 wordpress-single.conf
lrwxrwxrwx 1 root root   40 Nov  6 16:39 wordpress.conf -> /etc/nginx/includes/wordpress-multi.conf

Hello! Is this still the current best process for getting an archived multisite installed on Local? The steps have changed a bit with different versions and I’ve had mixed success. With a recent site I was not able to get it working. Would you mind reposting the steps from creating the backup to working in Local?

Hey @lessis

The above steps are mostly to convert an existing “regular” site in Local into one that can support Multisite.

Any way you do go about this will involve manual steps, especially to the Database since the urls are changing.

While the above commands do work, I would likely do it slightly differently:

  1. Create a new, blank multisite in Local. This will ensure that the Local server config is correct.

  2. Manually extract the zip backup somewhere, for example on your desktop.

  3. Move and replace the contents of the wp-content folder from the Desktop location over the wp-content folder within the ~/Local Sites/example-site/app/public/wp-content folder

  4. Drop the Local DB tables, and manually import the DB from the backup. This is up to you how you’d like to do it. Personally, I feel like ssh'ing into the container and using wp db commands to be the easiest method for doing this.

  5. Generate the necessary SQL to update the URLs in the database. Step 4 of this help doc outlines that pretty well: https://getflywheel.com/wordpress-support/how-do-i-go-live-on-flywheel-with-a-multisite/ and makes use of this tool to help generate the SQL: https://wpmultisitedomainreplace.com/

  6. Run the generated SQL commands against the DB to update the URLs. Again, this is dependent on how you’d like to work, but I’m all for using wpcli.

Hope that helps give you a general workflow. The other option is what’s outlined in the above comments, where you basically import the site using Local’s import functionality, and then take the necessary steps to update the server settings.

Let me know if you have any questions!

– Ben

2 Likes

This is the way to do it when working on a windows machine without SSH (windows 8 and older).

Thanks :heart:

1 Like

I did this and, running the check it command @ben.turner gave…

ls -alh /etc/nginx/includes/

I get the result I wanted. Yet in the Local by Flywheel instance the site is still shown as Multisite: No

Should I be worried?

As a dev, I’m usually pretty worried about a lot of things :bug: :smiley:

To be honest, working with Multisites in Local needs to be improved on, and is something that’s on the roadmap to be worked on.

In the meantime, I think that if you are able to log in to the WordPress admin and create new subsites, then it’s likely working correctly, even though Local indicates that it’s not a multisite.

Import site from ZIP.

Quit Local Lightning.

On Linux…
/home/your-name/.config/Local/sites.json

Find text: multiSite

Change “multiSite”:null -> “multiSite”:“ms-subdir”

Run Local Lightning.

Is this safe? In overview it shows “Multisite: Subdirectories” and it works. I can’t believe, that this is the catch.

1 Like