When you want to change the hosting for your blog, you can have several options to perform this task.
But none is really easy…
mysqldump --default-character-set=utf8 --extended=false -uuser -ppassword database > sav.sql
or
mysqldump --default-character-set=utf8 --extended=false -uuser -ppassword -hhost -Ssocketfile database > sav.sql
The good point is the database is fully exported.
The problem with this option is to change manually some paths and URLs in the file before importing in a new database.
In the export.sql file, you have to change at least before importing in the new database
/path/to/files/ home siteurl
mysql -uuser -ppassword < import.sql
file wp-settings.php
$mysqlsavefile=dirname(__FILE__)."mysql-db/".DB_NAME.".sql"; $mysqloptions=" --default-character-set=utf8 --extended=false -u".DB_USER." -p".DB_PASSWORD." ".DB_NAME; $command="mysqldump $mysqloptions > $mysqlsavefile"; exec($command);
WordPress includes an export feature to save the content of your blog in a XML file. The format is WXR, a custom WordPress XML format.
But this file will only save the content of your blog and none of the plugins or themes options.
And users passwords are also reset.
And attachment like images can be duplicated but are not fully managed (no thumbnail!)