Complete Step by Step directions for WordPress Multisite setup
There are a ton of blogs and directions about how to setup WordPress Multisite, but none took you through all the steps that were needed. I just recently combined eleven separate sites, each with their own separate domain name, into a single WordPress MU setup on a new host. I just moved over to iWF Hosting and so far LOVE them. Using my method below will keep your total downtime to zero as you will transfer the domain as the last step.
Here is how I did it, step by step. If you have any questions about the process, please comment below.
*1.) Designate one Domain as your “main” domain. It doesn’t matter which one it really is, but this will be the one your Super Admin logs into. Transfer this domain to your new host. It will likely be tied to your account somehow, which is fine. Note that the transfer can take up to 48 hours, but typically will take 4-12 hours. You won’t be able to get past this step until the DNS transfer happens though, so if it’s on a live site – that site will be down for a while. For this reason I used a throw away domain so that none of my important sites would be down.
*2.) Install WordPress and configure MU per WordPress Codex instructions.
*3.) Combine all Themes and upload in to the wp-content/themes folder on the new host.
*4.) Combine all Plugins and upload in to the wp-contet/plugins folder on the new host.
*5.) Setup each site under Sites -> Add New. These will initially be setup as directories under the “main” domain. So you’ll have http://MainSite.com/Site2, http://MainSite.com/Site3, etc. To keep this simple for me, my site2 was the full domain name minus the .com part. This way I could look at it easily and know what site I was working with. Site title doesn’t matter at this point, but Admin Email will designate the admin user for later on. I simply set this to the email address of my Super Administrator that was setup in step #2.
*6.) Plugin and Theme activation is a bit weird. You can force a specific plugin or theme (or all of them,) to be active on all sites “network wide” using the Network Enable option. Or installed themes and plugins can be activated on a per site level. I did a combination of both. Performance plugins such as Cache Plugins, Google Analytics, and my adverting plugins were Network, while plugins that perform specific actions were on a per site level as need. This allowed me help keep resource usage at a minimum. The per site plugins are enabled under the normal Dashboard -> Plugins method.
Themes can be activated Network wide, or per a site level also. BUT, to do so on a per site level, you have to go into Sites -> Site name -> Edit -> Theme Tab to enable the themes you wish to be visible to that site. IAfter enabling the theme on the per site level, go into the site’s Dashboard, then activate that theme. In my case I made sure there was only one theme to activate, but I still had to manually activate it for each site. Otherwise the theme frequently defaults to whatever the main network theme is (on your throw-away domain name,) or to the default WordPress Theme.
Note that if you make any edits in the theme (such as hardcoding site name, hardcoded links to a commerce solution, CSS Style Sheet tweaks) it will show up on all sites that use that theme. So it might make sense to you to make sure that each site uses a completely different theme. It’s also a good way to make a large number of sites look exactly the same though.
*7.) Export (Settings -> Tools -> Export) your old WordPress blog. Do everything, unless you want to take this chance to remove stuff such as comments or users. I tried to use a variety of backup plugins but they all had issues, were a pain in the behind to setup, or just plained failed to work due to resource restrictions. Export is simple and takes seconds even on a large site.
*8.) Install the WordPress Import Plugin. Settings -> Tools -> Import -> WordPress. It’s one click there and installs Network wide.
*9.)In WordPress MU, click on Sites -> New Site Name -> Dashboard. This puts you into the dashboard for the new site. Import the file you exported from step #7 under Settings -> Tools -> Import -> WordPress. Choose the export file from your computer. Click the box to include media.This will take some time and doesn’t give you any kind of timer. On some sites it may time out due to resource issues. I read all kinds of ways to tweak this, none of which actually worked for me.
The best way for me was to note the number of images and posts on the old site. I then opened two tabs in my browser to the New Site. One tab was the import process, the other was opened to the posts page. The import process started moving media files first, but will fail on most anything that is not an image. So note the failures as you will need to move them manually – usually this is because they’re too large in size. I believe the limit is 10mb. I would then refresh the post page every five minutes and make sure the number was rising. If it stopped for more then ten minutes, I simply went back to the import tab and hit refresh on the page then clicked “send.” This simply starts the import process over, BUT it skips everything that has already been downloaded/imported! Files and posts that exist already will generate an “error” message so you know that it’s working.
It took me about two hours to move 4gb of images and another three hours to move 1000 posts and about 5000 comments. I probably refreshed the import page about every hour. Lastly I manually uploaded the rest of the Media attachments that didn’t transfer over and edited the posts that they were attached too.
Note that the import will also pull over users. It will try to match user names, so Admin Posts will go to Admin. But it will keep the original user unless you specify otherwise, OR didn’t import the users from the old site. Also note that all users on one blog can now be users on all blogs in your network. This is editable under the Site -> Site Name -> Edit -> Users tab.
*10.) Once the import is done, I setup the new site however I wanted it. I enabled the required plugins, configured adsense, made sure everything (except the domain name) worked and looked like I wanted it too. In my case this was pretty much copy the old site exactly and set it up the same way. This only took me about five to ten minutes per a site because I wasn’t doing anything crazy. Make sure you tweak things like your permalinks, site name and tagline, Widgets, etc. Note that whatever your site name is, that will show up under the “My Sites” Button. So you want to be a little different in the site names. Oh, and do not forget to trash the Sample Page and Sample Posts.
While you’re setting things up, you can “Visit Site” easily by going to My Sites -> Site Name -> Visit Site.
*11.) Now is the time to move your domain name. Go to your DNS Provider and switch the DNS from the old host to the new one. If your host is also your DNS provider, you may have to transfer the domain name over. I personally keep DNS at my Domain registar so I can move from host to host easier.
*12.) On your new host you should be able to “Park” the rest of your domains. If you’re in CPanel there is an option to Park Domains.
*13.) In your main site, WordPress MU Dashboard, install the Plugin “WordPress MU Domain Mapping.” It must be network enabled. Go to Settings -> Domain Mapping. In the Server IP address put in the IP address of the server where your files are hosted. OR just put in the CNAME (usually your first domain name.)
*14.) Go to Sites -> All sites. Hover the mouse over the new site that you want to map to a specific domain. Look at your status bar of the web browser to see where that link goes to. At the very end of that link is an id=x, where x is a number. Remember that number.
*15.) Go to Settings -> Domains. Site ID is the number you noted from step 14. Domain is the fully qualified domain name. So enter www.mainsite.com. There are several options here to setup domains, I suggest this blog post if you want to tweak any of them.
At this point you are done. If you do it this way you will have no downtime when transferring from the old host to the new one. I used the same Google Analytics code, so there was not even a drop in stats. As peoples and the host’s DNS updates it will automatically go from the old site to the new site.
Please let me know if you have any questions or problems!