Joined October 2012
·

Tobias Block

Application Engineer at Ogilvy & Mather
·
Duesseldorf, Germany
·
·
·

Posted to Migrating Wordpress databases over 1 year ago

At first glance a good idea, but if you take a look into the database you will notice that some data is php-serialized.

php-serialized means, that an array was converted into a string (in this case to be stored in a database) and it looks like:

a:4:{s:25:"dashboard_recent_comments";a:1:{s:5:"items";i:5;}s:24:"dashboard_incoming_links";a:5:{s:4:"home";s:54:"http://testsite.preview.ogilxxxxxx.de";s:4:"link";s:130:....

This structure is always built with the information about the string length. In this case: 54 chars. If your new Url has another length, the database field can't be unserialized. To replace the URL you have to unserialize the string, replace the url in the array and serialize it back.

Wordpress recommends the search and replace script. [1]

In addition I think the system of storing absolute urls in the database might not be a good idea, but the wordpress team made this decision unfortunately.

Posted to My git log over 1 year ago

wow it's look very pretty ;)

Achievements
66 Karma
1,441 Total ProTip Views
Interests & Skills