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
So simply follow these steps:
- Create a backup and download it (following this article - https://getflywheel.com/wordpress-support/create-backup/)
- Drag the downloaded zipped backup on to Local and that should start the typical import process.
- 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
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
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:
- Right-click on the site in Localās sidebar
- Go to āOpen Site SSHā
- 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:
- Right-click on the site in Localās sidebar
- Go to āOpen Site SSHā
- Run the following command:
ln -sf /etc/nginx/includes/wordpress-multi.conf /etc/nginx/includes/wordpress.conf
- 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:
-
Create a new, blank multisite in Local. This will ensure that the Local server config is correct.
-
Manually extract the
zip
backup somewhere, for example on your desktop. -
Move and replace the contents of the
wp-content
folder from the Desktop location over thewp-content
folder within the~/Local Sites/example-site/app/public/wp-content
folder -
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 usingwp db
commands to be the easiest method for doing this. -
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/
-
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
This is the way to do it when working on a windows machine without SSH (windows 8 and older).
Thanks
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
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.