Moving WordPress to another domain

If there is a need to move WordPress installation to another domain or move it from production to localhost, launching of copied files and database will not work. Posts stored in database and some wp options contains information about domain name, so dynamic links will redirect to unknown pages. To fix this, after copying database and necessary files to new domain, just simply replace mentioned entries directly in MySql using sql commands.

For wp_options table in Your WordPress:

For wp_posts table in Your WordPress:

Those changes should properly set new domain and make it work.

This is not the only way to move WordPress – contains detailed information about moving to another location.

Also there is a very usefull tool to search and replace domain entries in database without using any sql command. This tool is available here: Search And Replace Tool. It’s a single script file which can be use not only with WordPress.

Leave a Reply