I am looking for a safe way to import independent blogs into a WordPress MU installation.
The basic idea is to merge multiple blogs running on subdomains into a single wordpress installation with MU feature.
I can use the WordPress export/import feature but it would not work in my case with some of the blogs having a lot of content. I have played with this option. Not worth it. Export would time out even on localhost.
I also need the postid to remain same so that links do not break.
I have spent a lot of time looking at the options I have. Import using PHPMYADMIN seems to be the only way out. But I am not sure what would be a safe way to import using this route!
Any ideas!
I don’t know of you like the sound of domain mapping but check out http://codex.wordpress.org/Migrating_Multiple_Blogs_into_WordPress_3.0_Multisite and check out number 6 if they are on the same server. If not import seperate install into them so that number 6 works.
Have you tried increasing the php script execution timeout values in your
php.ini
file (or perhaps in.htaccess
)? I think I’d try that route first, if possible. You probably could setmax_execution_time = 180
, or perhaps even higher. It’s possible that you might also need to bump up the memory limit, too. Add something like this to yourwp-config.php
:Then, on the import side, you might run into upload size limits. Another
php.ini
tweak:Alternately, it’s possible to split the WXR file into smaller pieces. I have a perl script for this, but I wrote it for a client, and would need permission to share it. But if you’re interested, I can ask.
A little-known secret of the importer is that it will skip over information that it has previously imported. So if you get past the upload size limits, but the import times out part-way through, just try importing the same file again. It will quickly skip over the data that’s already in the database, then pick up again where it left off. But that makes me nervous, because it’s not foolproof: If it imports a post, but times out before saving the all the post’s metadata, the metadata might get skipped.
Another option that I’ve seen eliminates the WordPress export/import option and goes directly to SQL dumps. The basic procedure is to create the new domain in multisite to get the ID, tables, etc., then do a SQL dump from the original, remove some tables from the dump (options, etc.), modify the remaining table names within the dump to match the database table names in multisite, then import the SQL dump and do housekeeping (author IDs, etc.).
Step-by-step at http://www.clausconrad.com/blog/migrating-a-bunch-of-wordpress-blogs-to-a-single-wordpress-3-multi-site-installation