Archive for lokakuu 2013

How to move a wordpress site to a new server

It’s not so easy to move a wordpress site to a new host/server. This is because the wordpress database is full of urls and paths that need to be updated manually. This could be done easily as normal find-and-replace operation if the urls and paths were saved as normal text. However, they are not. Especially in wp_options there are many settings saved in php-serialized format. They look like this:


As you can see, the string lengths causes problems. If you want to change the urls you have to recalculate the string lenghts. If there were 1000 urls, this would be quite a task to do manually.

I found a neat solutions for this. Download the wordpress search-and-replace tool to replace strings in database tables even if they are inside php-serialized strings. The tool calculates new string lenghts for you.