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