Introduction

When you want to change the hosting for your blog, you can have several options to perform this task.

But none is really easy…

MySQL dump

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

Crontab

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 Export/Import with XML/WXR

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

 
wordpress/migration.txt · Dernière modification: 2010/07/29 15:04 par 90.2.59.137 microWebAgency.com
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki