Copying a WP site into WPMU
I look after nine blogs.
Six of them are on my own servers and three have their own hosting. After my last post, I thought I would try an experiment – to combine several of those blogs under one roof, so simplify maintenance and to streamline things. Checking nine blogs on a regular basis for updates and upgrades can be tedious.
I set up WordPress MU on a test site. For the sake of the test, I used a few spare domains I had lying around.
Installation of WPMU is simplicity itself, requiring only the basic knowledge of how to install a database [I used Cpanel] and the ability to change permissions on the server [again using Cpanel].
Having set up the root blog, I set up a subsidiary blog, and decided to try to mirror this site on it. Once again, setting up the blog could not have been easier, but then my troubles started – how to I import all the features of this site onto the new one? I want the two sites to be precise mirrors, so this involves copying the theme, the posts, comments, images, tags, categories and links.
Copying the theme is simple. I just took a copy of the live theme folder, put it in the WPMU installation and activated it.
Copying the posts was relatively simple too. All I did was to export the XML file from this site and then import into the other. This gave me the ability to copy all the images as well which was just what I wanted.
I was now left with a problem. The XML export/import facility does not include links or link categories. This required a bit of lateral thinking.
In the end, I decided to use the sledgehammer approach. Using PHPMyAdmin, I exported this site’s entire database excluding “wp_options”, “wp_users” and “wp_usermeta”. I then opened the downloaded file and made a simple change.
To explain the change I made, it is necessary to understand the construction of the WPMU database. The root blog will contain its records in, for example “wp_posts”. Anything starting with wp_ pertains to the root, or the global site. The individual sub blogs contain a numerical prefix, so you will end up with “wp_2_posts”, “wp_3_posts” and so on.
I ascertained which prefix my sub blog was using and then did a simple find and replace on the entire database dump, replacing “wp_” with “wp_2_” or whatever the prefix is. I then imported this file into the new WPMU database.
It may seem that I have duplicated things here, as I had already imported the posts and comments, but I did that essentially to just import the images. I overwrote the information to maintain the integrity of all the ‘meta’ tables.
The result is rather effective – you can see it here, though please don’t leave any comments on it, as they will be dumped!
My next problem [and it’s a big one], is how to map my domain to pont as an alias to the new site. So far, I can only point a domain to it, whereas I want the domain to act as an alias and to mimic precisely the URLs of all the old pages.
Any ideas?
hi Richard,
I did the same only a few weeks ago. we (webworks.ie) started doing blogs for people, so I installed a copy of WPMU and migrated my own blog to it.
The way you map your domain to it is:
1. create the wpmu blog which will become your new blog, and import your stuff into it. You’ve already done this.
2. log into the backend of the new blog.
3. under “tools” in the left menu, choose “domain mapping”.
4. add your domain name to it. don’t set it as the primary domain yet.
5. repoint the A record of the old blog so it points to the WPMU one.
6. when the propagation is completed, set the domain as the primary domain.
Did I understand the problem right?
Thanks for that Kae.
The problem as it stands at the moment…
The Primary (base) blog is set up using the domain ‘curratech.net’. I copied this site into a new child blog on WPMU, and its address is now ‘curratech.net/apipeandakeyboard’
I can point ‘apipeandakeyboard.com‘ at ‘curratech.net/apipeandakeyboard‘ but the latter still appears in the address bar, as it’s only a pointer. What I want to do is create an alias so that every instance of the string ‘curratech.net/apipeandakeyboard‘ is replaced by the string ‘apipeandakeyboard.com‘ thereby giving the impression that it is a standalone blog. So basically, I want there to be no difference between the old and the new in all cases.
Will your fix do this?
Surely, isn’t the majority of this method obsolete, seeing as WordPress 3.0 combines WPMU with the main WP trunk?
ah – no, I don’t think so. I always set my sites up as full domains in their own right, so converting a subdomain blog to a full domain is something I didn’t have to do.
hmmm… I might have to play around with this to figure it out. not right now, though – well behind on my book, and I need to catch up on that and my work. hopefully on the weekend I’ll have the time to try some things.
in the meantime, you should ask at the wp forums.
@Kae,
Just for the hell of it, I installed Doncha’s Domain Mapping Plugin and followed your instructions to the letter. Didn’t work. Server not found! It’s possibly because I’m using a shared IP?
@TheChrisD,
I honestly don’t know what the story is with the integration as, as far as I know there isn’t a pre-release of WPMU3 so I don’t know what’s coming down that track. Presumably though the problem of domain mapping will still remain, no matter what the architecture of WordPress?
As far as I’ve read, Chris D is right in saying WPMU has been merged with the WP trunk. From WP 3.0 on, WordPress (single site) and WPMU will be available as a single download.From that point the install can be set as single user or multiple user. Once that’s done the features/functions/setup should be the same as before for either one or the other.
Seeing as how you’re rather more experienced in the domain mapping and working with WP DBs and the like I can’t offer any ideas from my own experience but this thread from the WPMU forums might give you some ideas.
http://mu.wordpress.org/forums/topic/13582
It’s somewhat dated but I don’t believe anything has really changed as far as the functions are concerned.