Dear Christina

Commonsense solutions to Wordpress problems
        

Moving Wordpress site to new host

Dear Christina,

I’ve really screwed up this time. I’m moving my WP site to a new host and I changed the DNS settings before exporting my database and WP files.


I’m unable to access the dashboard now and my old host is being uncooperative (account is active till end of the month).  Do you have any ideas for me or should I just forget it & start fresh?

Mary H Ruth-Virtual Writing & Communications Solutions

Dear Mary,

We’ve discussed this privately through email already but I wanted to share this with my readers.  Unfortunately, you are having to start from scratch with your site but, look at it as a lesson learned. One you’ll NEVER have to learn again.

For anyone else contemplating a move, here are the steps to take to ensure you do it correctly and safely.

Moving from one host to another:

First and foremost, BACKUP EVERYTHING to your own computer.

  • use plugin WP-DB-Backup to have your entire database backed up and either download it to your computer or have it emailed to you. Be sure to write down the name of the database, username and password
  • Using your favorite FTP program, download your entire Wordpress installation files (wp-admin, wp-content & everything else)

Place everything in a folder named “old blog”

Now, only if the domain name is changing, go back to your dashboard under “settings –>general”  you’ll need to change the listed URL to the new one. Then backup and download your database and WP installation files again. Save to a folder named “new blog”.

You can change your DNS settings at this point.

Most hosts have the “quick install” option for WP. In that case, use it to get WP set up easily on your new host.

Now you just need to get your old database files into your new database. You can do this through phpmyadmin if you have access. Please check with your hosting company to get instructions on how to upload the database files. There are too many ways to do this (depending on host) that it would take me forever to cover them all.

Generally you will need to set up a new database and name it the same as your old database. Also set user and password the same. Then upload the old database file into the new database.

Only if you changed domain name: You have to open your old database file (unzip it and open in notepad) and replace all instances of your old domain name to the new one. You can use the “find-replace” option in notepad to make sure you got them all.

When you do that and go to yourdomain.com/wp-login.php you will be told your database needs to be updated, which is fine. Run the process (very quick) and all your old posts should be available now.

Now you’ll need to sign into your new host by FTP and upload your WP installation files, overwriting the one that were installed with the “quick install”.

**If you get a “database”  error at your URL after uploading, you have to open up your wp-config.php file in notepad and make sure database name, username & password all match what is set in your new hosting account.

You’ll have to go through each setting on the dashboard to make sure all are set the way you want them. Also you’ll need to set your theme.

Guess what? You just did that all by yourself! Not as bad as you thought, huh?

~Christina

wordpress

Tagged as: ,
  • lawless
    Also, sometimes, hosts will have an IP address where your site is accessible.

    You can access it through the IP address directly if your DNS info has been changed.

    Easiest way to dump out the database is to use phpMyAdmin and select the export tab. Select All , choose SQL, make sure Structure and Data are checked and check the "Save as file" box at the bottom.

    This will dump out a full SQL backup of your db. On your new host just select the "Import" tab and import the SQL file.

    This way everything is native to phpMyAdmin and you won't have formatting issues with a plug-in backup and phpMyAdmin import function.

    Any decent host that has mySQL databases will have a phpMyAdmin interface.
  • Thanks so much for adding that info. Some of my more "adventurous" readers will be able to utilize your suggestion.
  • Waitwaitwait! Just because you changed the DNS settings doesn't mean that the old site is inaccessible!

    Just change the DNS settings to point to your old host, and grab your stuff!

    If for some reason you can't do that, edit your HOSTS file on your computer to point to the old server
    For instructions see "External Links" at the bottom of this Wikipedia article: http://en.wikipedia.org/wiki/Hosts_file
  • Dave,
    You are correct. Completely forgot about changing back.
    Even though Mary and I discussed it, the whole "account active till end of month" didn't sink in to my brain receptors apparently. :-)

    Just goes to show, we are all constantly learning. Sharing what we know helps others.

    ~Christina
  • Thanks Christina - Got this properly bookmarked!
blog comments powered by Disqus