How can I export all the content from a "large" WordPress site?

1

1

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?

Frew Schmidt

Posted 2013-03-27T17:47:01.410

Reputation: 1 062

Question was closed 2013-04-01T15:27:21.227

1rysnc/copy the root folder that your Wordpress install lives in and a database dump should grab everything you need from the site. – jmreicha – 2013-03-27T17:55:53.153

@jmreicha You should put that in as an answer.. I'd up-vote it. :) – Ƭᴇcʜιᴇ007 – 2013-03-27T18:14:56.057

@techie007 answer posted :) – jmreicha – 2013-03-27T19:22:57.867

Answers

2

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

TomEus

Posted 2013-03-27T17:47:01.410

Reputation: 3 355

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 – 2013-03-27T18:45:24.317

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 – 2013-03-27T22:18:01.633

I'm looking at ikiwiki, there is already xml conversion stuff. – Frew Schmidt – 2013-03-27T22:29:35.050

2

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.

jmreicha

Posted 2013-03-27T17:47:01.410

Reputation: 1 671

2

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:

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

ob_start();
export_wp();
$xml = ob_get_clean();

file_put_contents('out.xml', $xml);
echo "done"
?>

Frew Schmidt

Posted 2013-03-27T17:47:01.410

Reputation: 1 062

0

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).

Peter

Posted 2013-03-27T17:47:01.410

Reputation: 566