Switch to Multisite on Local?

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?

1 Like

Just looking for a quick reply from anyone who might know the answer to this? Thanks.

Hi @ViscoDesign,

If you’re running the Preferred environment, see my post here: Multisite Migration Live to Local

Otherwise, if you’re running the Custom environment with nginx, you can do the following:

  1. Create a fresh site Custom site with the type of multisite you wish to use
  2. 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.
  3. 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
  4. Restart the site

We have plans to improve this process. Sorry for the extra work!

1 Like

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

3 Likes

Hey @ViscoDesign

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.

– Ben

I also try it and it’s working awesome thanks ViscoDesign

This didn’t work for me. I wonder if that’s because I’m using Wordpress 5.2?

  1. Adding

define( ‘WP_ALLOW_MULTISITE’, true );

has no effect.

  1. Inserting the entire script

define( ‘WP_ALLOW_MULTISITE’, true );
define( ‘MULTISITE’, true );
define( ‘SUBDOMAIN_INSTALL’, true );
$base = ‘/’;
define( ‘DOMAIN_CURRENT_SITE’, ‘ngixntest.local’ );
define( ‘PATH_CURRENT_SITE’, ‘/’ );
define( ‘SITE_ID_CURRENT_SITE’, 1 );
define( ‘BLOG_ID_CURRENT_SITE’, 1 );

generates the error:

This site can’t be reached

ngixntest.local ’s server IP address could not be found.

Try:

ERR_NAME_NOT_RESOLVED

Hi Clay,

Can you update the instructions to the current version of flywheel using Wordpress 5.2? I did not find a directionr called “do-not-modify”

Thanks

1 Like

Hey @clay,

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.

Thanks in advance

1 Like

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.

7 Likes

@jake Thank you! This is quite faster then reimporting as multisite!

1 Like

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.

1 Like

ms-subdir for a subdirectory setup. ms-subdomain for a subdomain setup.

2 Likes