Tag: importing and exporting wordpress blogs’
WordPress Mu Tips: How to Import and Export Large Blogs Without The Hassle of Splitting The Files Up
- by Asher Bond
First, log in as a site administrator, then go to the blog you want to export from and choose manage -> export, and save your xml file.
Now log into the blog your importing to as a site administrator and choose manage -> import -> WordPress, and load up the xml file.
You probably get an error message like:
The uploaded file exceeds the upload_max_filesize directive in php.ini.
You could edit your php.ini, but I don’t recommend this because it’s the sledgehammer approach. You can probably use a little more finesse by simply editing your .htaccess file (assuming your web server allows .htaccess to override php.ini).
First try this.. edit:
/path/to/your_wordpress_mu_directory/.htaccess
Add these lines to the top (adjust the values how you need to):
php_value upload_max_filesize 15M php_value post_max_size 15M php_value memory_limit 48M
If you have over ~1000 posts, you may also need to (temporarily) increase the amount of time php scripts are allowed to run before the web server kills the process. Here’s how you can set the maximum execution time of a php script as well as the http request time to (600 seconds) 10 minutes. Thank you Rosalyn Metz.
php_value max_execution_time 600 php_value max_input_time 600
Now try again. If you get the same problem, you will need to edit your php.ini or get your systems administrator / web hosting provider to do it for you. Some web server configurations don’t allow users to override php.ini with .htaccess.
If you are successful, you will probably get a different error:
This file is too big. Files must be less than 1500 Kb in size.
The good news is that this means you have already configured php to allow WordPress to import your large xml file, but you still need to configure WordPress Mu to allow this. When you install WordPress, MU… it creates a record for each blog setting a variable called “fileupload_maxk” to 1500. This is what is limiting you.
Here’s the SQL code you can use to fix it by changing the variable(s) for every mu blog to a higher number (in this case 15000 bytes, but you can change it to a higher or lower number.)
BE SURE TO PUT IN YOUR DATABASE NAME HERE:
UPDATE `__your_wordpress_mu_database_name_here__`.`wp_sitemeta` SET `meta_value` = '15000' WHERE (`wp_sitemeta`.`meta_value` = 1500) AND (`wp_sitemeta`.`meta_key` like "fileupload_maxk");
When you create new blogs, they will still default to 1500. If you want to change this also, you must edit two files:
/path/to/your_wordpress_mu_directory/wp-includes/wpmu-functions.php
and
/path/to/your_wordpress_mu_directory/wp-admin/includes/mu.php
Just change:
get_site_option( 'fileupload_maxk', 1500 )
to
get_site_option( 'fileupload_maxk', 15000 )
(….. or some number of bytes you want instead of 15000.)
That’s it, you should be able to import wordpress blogs as large as you want now.