I need to create wordpress export dump (.WXR) using SSH on my server. I have lost access to the Wordpress dashboard.Can it be done using some unix,mysql script.
As blogged here, all you need is the export_wp
function, so run something along the lines of.
include 'wp-config.php';
include 'wp-admin/includes/export.php';
ob_start();
export_wp();
$file = ob_get_contents();
ob_end_clean();
$fh = fopen("wordpress-" . date('Y-m-d') . ".xml", 'w');
fwrite($fh, $file);
fclose($fh);
Then just grab the .xml file generated!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With