I have a moderately sized WordPress blog, I'd call it small even, but when I tried to export the posts, comments, pages, etc, the page times out. I have ssh'd into the server and can see that the command runs for 90s while pegging the CPU and then "crashes". I imagine it's actually a timeout on the client end but I configured firefoxes timeout to be longer and it made no difference. It could also be Dreamhost killing the script.

What can I do?

| improve this question | | | | |
  • 1
    rysnc/copy the root folder that your Wordpress install lives in and a database dump should grab everything you need from the site. – jmreicha Mar 27 '13 at 17:55
  • @jmreicha You should put that in as an answer.. I'd up-vote it. :) – Ƭᴇcʜιᴇ007 Mar 27 '13 at 18:14
  • @techie007 answer posted :) – jmreicha Mar 27 '13 at 19:22

1) You can user number of plugins for WP backup/clone. I personally used this one: WP Clone

2) If for any reason that is not an option you will need to backup all of your files from the WP directory. Next is the mysql B backup. If your host has cpanel it's simple:

Go to 'backup', under the 'Site Management' header in Cpanel.
Underneath where it says "Download a SQL DB Backup", click on the database name that you wish to backup
Select a place and filename for you to save on to your local computer
Do NOT attempt to open this file with Winzip.

if not, just google mysql backup

next go to your new location and restore the mysql DB copy all of the files to the new WP directory

That's all - but if you are not familiar with Linux/Unix I do recommend going the plugin route

| improve this answer | | | | |
  • I'll try this. It's too bad because ultimately I'll still want that xml output because I'm actually converting to a different piece of software entirely, but if I can run locally I can probably turn of auth or something and use wget. Will mark as correct if it works! – Frew Schmidt Mar 27 '13 at 18:45
  • OK, good luck - if you are converting to another software it really depends on what you need to get exported - posts only, users, authors etc. There are other plugin suited for that i.e. WP to Drupal – TomEus Mar 27 '13 at 22:18
  • I'm looking at ikiwiki, there is already xml conversion stuff. – Frew Schmidt Mar 27 '13 at 22:29

This answer will assume that you are familiar with command line, if not I'm sure there are plugins that work although I have had much better luck doing things without them. I can update my answer if a plugin is necessary.

Step 1: Dump out your wordpress database. To do this use the following command:

mysqldump -h hostname -u username -p wordpress > blog.sql

Where blog is your Wordpress site's database (it can differ but this is what it is usually called).

Step 2: Copy your Wordpress site. You may need to play with this but it will be similar to the following:

rsync -av /var/www/wordpress /path/to/new/site

wget may also work, so that may be an option as well, it is up to you as to which one to use.

Make sure www-data has the correct permissions:

chown -R www-data\: /wp-contenet

Step 3: Read the database in to your new Wordpress Location.

mysqldump -h hostname -u username -p wordpress < blog.sql

Step 4: Edit wp-config.php to reflect the new and correct settings.

Note: You may need to run some SQL commands to get everything to show up correctly on the new site.

| improve this answer | | | | |

I won't unmark the other answers, as they are probably more right for most users, but I ended up going my own route because I really need the XML export version:

And for posterity, here's the script:

require(dirname(dirname(__FILE__)) . '/wp-load.php');
require(ABSPATH . 'wp-admin/includes/admin.php');

$xml = ob_get_clean();

file_put_contents('out.xml', $xml);
echo "done"
| improve this answer | | | | |

In regards to the actual problem, this is a server limit that is not allowing the process to execute completely. You are likely exhausting an Apache or PHP memory limit. This could be fixed by contacting your host, but the easiest way is to find another (and better) method of exporting the site. This can either be done by CLI (rsync files and a mysqldump/import), else if they run cPanel or some other GUI, there may be some kind of backup/transfer option there (even performing the dump via PHPMyAdmin could make it easier for you).

| improve this answer | | | | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.