WordPress broke after moving to new location

Posted in Articles

Tweet This Share on Facebook Bookmark on Delicious Digg this Submit to Reddit

It is very common to have WordPress site break after moving to a new location — also known as migrating WordPress from one location to another server.  One common reason is because the domain name changed and the WordPress database is still referencing the old domain name.

Suppose we have moved the WordPress files from one location to another.  And perhaps we moved the database as well.  And we even got the new files to connected to the database properly.  But still, site does not look right.  And there is problem logging into the WordPress dashboard.

The final step is to change the database internal value from the old domain to new domain name that you have moved to.  Although you can try, it is often not good enough to just export the database into and .sql file, do a search and replace, and then re-import.  This is because  the database may contain “serialized data”.  You may need to do a search/replace in database by using some some tool that can handle “serialized data”.

We’ll use the Database Search and Replace script, where we download the script files and upload to our new WordPress location in a new subdirectory.  It is important that you put this script in its own sub-directory (and give it a subdirectory name that no one knows).  Because you need to delete this script afterwards.  And the button in the script that does the delete will delete the whole sub-directory that the script is in.  You don’t want it to wipe out your entire website files.

Anyways, this is a complex and powerful tool and it can do a lot of un-repairable damage to the site and/or database if not used correctly. Backup your database before using.  This is not a tutorial on how to use the tool.  So if you don’t feel comfortable using the script tool, try to hire a professional that can do.

Needless to say, that fixed the website for us after moving to new location.  Your particular problem may vary.