Congratulations, you just sold your website!
One tiny problem – you built the website using blogging software, like WordPress. Unlike a regular website that contains static files (that you can just download and email to the buyer, or upload to their host), blogs contain databases and scripts that need to be transferred. How on earth do you do that?
Well, you follow these steps!
**Note : For this tutorial, I’ll be talking about migrating a WordPress blog since it is the most common platform. The steps for other blogs are similar, and backing up the databases is exactly the same process – but if you’re using another type of blog, you will need to modify some of the steps to work for you.
I am also assuming that the domain name is staying the same, and that the domain is already transferred and pointing at the new website. You will need to make additional changes if the domain name is changing as well.
Step 1: Update to the newest version of WordPress
Thankfully, WordPress has now made this extremely easy. (This step applies to versions newer than 2.7. If you’re running an older version of WordPress, you’ll need to manually update your blog using the steps found here.)
To check what version of WordPress you’re currently running, simply login to your Dashboard (www.YOURBLOGURL.com/wp-admin) and go to Tools -> Upgrade in your menu (on the left hand side of your dashboard.) If you’re running the newest version of WordPress, you’ll see a screen like this :
That is good news! It means you can move on to step 2. If, however, that screen tells you that there is a newer version of WordPress available, there will be a button that says “Upgrade Automatically” on that page. Click on it. Congratulations, you just updated your version of WordPress!
Step 2: Backup Your Databases
This step is probably the most daunting part of transferring a WordPress installation, because most people don’t even know where to begin. You can relax though, the steps are very simple. Just follow me!
First, you need to login to your hosting control panel (the same place you create new email accounts, add new domain names, and perform other administrative tasks on your web hosting account.)
Scroll down through your control panel until you find “phpMyAdmin”, which looks like this :
Now click on phpMyAdmin, and you’ll be directed to a screen that probably looks pretty intimidating. On the left hand side, you’ll see a list of your databases (if you have more than one.) Click on the database for this WordPress blog, and you’ll see the screen change to something like this…
… and honestly, you can ignore 99% of that. Today, all we’re going to be dealing with is the “Export” feature (see the arrow in the image above.) Click “Export”, and a whole bunch of options will come up. You can leave most of these as the default options, and everything will work just fine. However, there is one option under “Structure” that we have to select, called “Add DROP TABLE/VIEW/PROCEDURE/FUNCTION”. You can see it here :
You’ll get a window that asks you whether you want to open or save the file, and obviously you want to choose “Save”. Save the file to a place you’ll remember, like your desktop or a special folder that you created specifically for moving WordPress. You’ll now have a file on your computer probably named “wp_something.sql”
That’s it! That is all you have to do to backup your database.
Step 3: Backup Your WordPress Files
It is easiest to do this using FTP. A program like FireFTP, which is a plugin for FireFox, will allow you to do this easily. (To see how to setup FireFTP, check out this post!)
If you already have FireFTP setup (or you’ve followed the steps in my post on setting up your WordPress blog), simply open up FireFTP in your browser, and connect to your website.
Click on your public_html folder (if you see one). If you installed WordPress inside of a directory (for example, if your blog is at YOURURL.com/blog instead of just YOURURL.com), double click on that directory so that you can see all of your blog files.
It should look something like this :
You will want to select all of these files (either dragging your mouse over all of the files to select them, or by pressing CTRL-A) to download them to your computer. (**Note – if you have other folders on this domain, or files that your buyer will not be getting, make sure you leave them on your website by holding down the CTRL key and clicking on the item. That will de-select the file, so that you don’t download it.)
Make sure that your wordpress backup directory (the one containing your database file) is open on the LEFT side of FireFTP, and then drag and drop all of your WordPress files from the right side of FireFTP (your website) to the left side (your computer).
Now all of your themes, plugins, and bloggy-things are backed up, on your computer!
Step 4: Install WordPress on the New Host
Since we’ve already covered this in detail on this blog, I won’t go into it all over again. You can read this post to find out how to install WordPress on the new host! The only important detail here is to install it manually (NOT using Fantastico) and to try and use the exact same username and password for your MySQL database. As long as your database name, username, and password are the same, things should run smoothly.
**Note : IF you use a different username, database name, and password, you’ll need to edit your wp-config.php file (the one you just downloaded to your computer) with the NEW database name, username, and password. Otherwise, WordPress won’t work!)
Step 5: Upload Your WordPress Files
You’ll need to create an FTP account on the new host, and login to it using FireFTP. On the left side (your computer), find all of the WordPress files that you have backed up. On the right side (the new host), find the directory that WordPress is installed in. It should look like this again:
You want to select all of the wordpress files on your computer, and drag and drop them to the right side of FireFTP (the new host.) FireFTP will now ask you if you want to overwrite the existing file with a window like this:
Select “Overwrite All”. This will replace all of the standard WordPress files from your new installation with the WordPress files you have backed up on your computer.
**Note : Remember that this tutorial assumes that your database name, username, and password are staying the same. If they have changed, you MUST update the wp-config.php file for WordPress to function!)
Now we’re almost there!
Step 6: Upload Your Database File
Now, we’re going to login to the control panel for the NEW host. Go to phpMyAdmin, as you did in step 2, and select the database that wordpress created for your blog.
You need to remove all of the pre-made WordPress tables in your database, before you can upload the new ones. So scroll to the bottom of the “tables” list, and click on “Check All”. Then, click on the drop down menu that says “With Selected :” and choose “Drop”. Like this…
It will ask you if you really want to drop those files, and click “Yes”.
Now we’re going to do almost the exact same thing as we did in step 2, except this time, you’re going to click “Import”, like this:
At the top, just below the line of buttons that say “Structure”, “SQL”, “Search”, etc. you’ll see a box called “File to Import”. Click “Browse”, and find the backup of your databases that you created earlier (called something similar to “wp_something.sql”)
Now go to the button in the bottom, right hand corner that says “Go” and click on it. This will import your old database to the new blog!
Step 7: Check Your Blog!
Once the database has finished importing, you want to go to the new site and make sure everything is running properly. Clear your cache and cookies before doing this, so that you can see the changes. If the blog shows up properly, with all of the posts and plugins intact, you’re all done!
And there you have it!
That is how you do a basic transfer of a WordPress installation from one host to another. Stay tuned for more site flipping tutorials, and make sure to add FlipFilter to your RSS Reader so you won’t miss any upcoming posts!