How to Migrate Your WordPress Website
If you have a growing WordPress site, it might be time to migrate your account to a better hosting plan. Many bloggers start out with basic shared hosting, but it's very limiting and you share server resources and bandwidth with hundreds of other site owners. Once you realize that your site performance isn't what it should be, it's time to migrate to cloud hosting. Your performance will improve and you'll have much more room to grow as your readership increases.
Before you start, you should have the target host account set up. The basic instructions are to export the various elements of your WordPress site and then import these files to your new host.
You also want to ensure that everything is backed up. "Prepare for the worst" is the best approach just in case the WordPress export is corrupted or lost. With a backup, should your migration fail, you can always default to the current host setup to keep your site active until you figure out the bugs?
Some hosts offer managed WordPress hosting and do the backup for you, but you should still do a manual backup in case any of these steps fail.
Step 1: Copy All WordPress Site Files
When you log in to your host account, you should see a list of files on the root of your hosting directory. When you install WordPress, these files are added to your host directory. However, as you add plugins and customize your theme, you accumulate more files in your WordPress folder. If you've hired a coder, some files might have different code compared to the standard install files. For this reason, you can't just install WordPress at the new host account and keep your current WordPress customizations.
Your host will either give you FTP access or a customized dashboard where you can access these files. Copy these files to your local computer in a temporary folder. Make sure you also copy all of the sub-directories, configuration files, and even the robots.txt file if you have one in the root of your site.
After you copy these files to your drive, you can set this part aside until later.
Step 2: Export Your Site's Database
The next step is a little more difficult, but luckily most hosts have a phpMyAdmin tool included with cPanel. This makes it easy for you to export all data and configurations to a text file that you will then use to import to your new host database.
After you open phpMyAdmin, you then see a tab named "Export." Click this tab and choose "Quick" for the export method. You can customize your export procedure, but you should only do this if you understand the way WordPress is laid out in the database and the SQL language to write customized queries.
For the format, choose "SQL." This means that the export will be SQL queries that will then let you more easily import data on your new host. After the export, download the text file to your hard drive.
Step 3: Create a New WordPress Database
This step is probably the easiest. Your host should have cPanel with a link to where you can create a new database. You can name it anything you want, but you should give it the same name as your old host account for simplicity.
Remember the username and password you create for the database. You can also use the same username and password that you have for your old WordPress hosting. This again makes it easier for you when you need to troubleshoot the migration.
Step 4: Install WordPress on Your New Host Account
You could just copy all files over to your host from your backup on the hard drive, but the configuration file for your new WordPress database and host account will be different than your old one.
You have two options: change the configuration file manually or install WordPress fresh, configure the settings, and then copy all of your files over to the new host excluding the configuration file.
The easiest way is to install WordPress, go through the setup procedure again, and then copy your old files and subdirectories to the new host location. In this step, go through the install process and use the information you created for your new database. If you kept it the same, you should have similar configurations as your previous hosting account.
You can check your installation by opening the site in your browser. You won't have any themes or plugins installed, but this will be fixed in the next step. You just want to make sure that the installation was completed successfully before you move on to the next step.
Step 5: Copy Your WordPress Files to the New Host Directory
When you configure your site, you change the content in the wp-config.php file. You don't want to overwrite this file when you copy your old files to the new host. This file is in the root of your web directory, so it should be easy to find.
When you copy over your files, they will have the same subdirectory structure. Just exclude the configuration file from the copy and move files from your local machine backup to the host.
One thing to note after you move files: You might need to upgrade your WordPress version if you were using an older WordPress on your previous host and installed a newer version. This can be done from your WordPress dashboard.
Step 6: Import Your Data
The final step is importing your data. You can do this from phpMyAdmin, which is where you exported your data. Use the file you exported, and the system will import your data including customizations and posts.
Cleanup and Testing
After you copy over the files, open your site again from the browser to test it. You'll probably need to check plugins as well to ensure that they are updated. Open posts and browse your blog to ensure that everything imported properly.