I have an existing site on Local. Is it possible to switch it to a Multisite by simply editing the config.php, or do I have to create a new site in Local and go through the full Multisite setup?
If so, is there a way to import the single site as a subsite?
Otherwise, if youāre running the Custom environment with nginx, you can do the following:
Create a fresh site Custom site with the type of multisite you wish to use
Go into the fresh siteās /conf/nginx/do-not-modify folder and copy the wordpress-ms-sub[dir or domain].conf file somewhere safe.
Go back to the existing site you wish to convert to multisite and remove /conf/nginx/do-not-modify/wordpress.conf and copy in the config file for multisite
Restart the site
We have plans to improve this process. Sorry for the extra work!
Thanks Clay. I had seen that post in my research, but my project was slightly different in that I was only working with a Local siteāno live site to migrate. Plus I figured there might be an easier way.
So I actually went ahead and did some testing. One approach I tried was to simply add define( 'WP_ALLOW_MULTISITE', true ); to wp-config.php in the existing site.
That seemed to work fine. It allowed me to go through the regular Network Setup within WP Admin. Once I did that, Local recognized the MS install and I could click Sync multi-site domains to hosts file. I didnāt even need to restart the siteāI just had to click away to another site and then back onto the site in question and Local recognized the new multi-site network.
Everything is working great after 24 hours, and some heavy development.
Note: this was performed on a custom environment: Apache, PHP 7.1.4, MySQL 5.6.34
Thatās good to know! Iām still learning a lot about Multisite, but as far as I understand, going from single to Multi is fairly easy, as you describe. Itās trying to go back/extract a site that has pain points.
Also how is it possible in a Custom Environment of Apache? When I create a new site (using subdomain) and then navigate to it I just get a ERR_NAME_NOT_RESOLVED warning:
This site canāt be reached sub.domain.local ās server IP address could not be found.
In Local 5.x, if you can edit the sites.json file in:
~/Library/Application\ Support/Local/sites.json
That file holds all the settings for all the sites. You need to find the site you are looking for. You can search for the directory name: site-name, and then after that find the multiSite setting. Something like "multiSite":null or "multiSite":"". Change that setting to "multiSite":"ms-subdomain". That will be a subdomain set up.
Just wanted to add that for Local Lightning + multisite subdirectories, the sites.json setting/value is "multiSite":"ms-subdir".
I exported a multisite Local by Flywheel backup and imported it into Lightning, but for some reason Lightning did not detect that it was a multisite setup which caused me to get a ātoo many redirectsā error. Manually editing sites.json fixed the issue.