For most of us there comes a time when we need to move our WordPress site for various reasons. Perhaps you didn’t like your host, maybe you outgrew your server. Whatever the reason, if you have a WordPress site, then there is a good chance your going to move it at some point and this tutorial will show you how to do just that.
The first step in this process is preparing our WordPress site for the move.
Preparing our WordPress site for transfer
Deactivate caching plugins
Caching plugins like W3 cannot just be deactivated via the plugin panel. You should turn off all running process via the plugin options first. E.g. page caching, browser caching, CDN ect…
The reason for this is to prevent possible errors that caching plugins like w3 can cause when moving a WordPress site.
The same applies to WordPress super cache, deactivate via the plugin settings before deactivating the plugin.
Downloading your content
Using an ftp program like FileZilla, connect to your server and download wp-content and any custom files outside of wp-content.
If you don’t know how to use FileZilla read my post on Backing up WordPress files as the process is similar.
Download your Database
Open up phpMyadmin found in your hosting panel to download your database. This is similar to backing up your wordpress database.
Once you have the following files we can move on.
- A copy of wp-content
- A copy of the Database
- Copies of any custom file outside of wp-content, for example an image folder or Favicon.
Uploading to the new Server or host
First you should install a fresh copy of WordPress on the new host or server.
Connect to the new site location with FTP and upload wp-content overwriting the default wp-content install.
Upload any custom folders and files associated with the site that were outside of wp-content.
Rename the plugins folder to plugins1, this will prevent any issues that plugins can sometimes cause.
To upload the database and ensure it goes in smoothly we need to make a slight change to our saved database.
Open the database using notepad++ by right clicking on the database and selecting edit with notepad++.
At the very top of the database you will see some information similar to this.
-- phpMyAdmin SQL Dump -- version 184.108.40.206 -- http://www.phpmyadmin.net -- -- Host: 220.127.116.11 -- Generation Time: Jan 12, 2012 at 02:47 AM -- Server version: 5.5.15 -- PHP Version: 5.3.8 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `your _database_name` -- -- -------------------------------------------------------- --
Delete everything above
-- -- Database: `your _database_name` --
Where it says
` insert your the new database name which can be found inside phpMyAdmin.
Do not delete the back ticks
` <—– just insert the name between them.
The final thing to do just before uploading is to delete all the tables currently in the new database, as these are just default wordpress tables and we want to add our own tables.
Scroll to the bottom select check all.
Click on where it says (with selected) which is a drop down menu and select drop tables like so.
Then select go, found in the bottom right corner.
A warning will appear asking you are you sure, just select yes.
Do not delete information Schema.
Upload your database with phpMyAdmin
Now that we have a clear canvas to work with we can upload our database.
Select the database we will be adding the tables to, i.e, the one you just emptied. Now you should just see a white screen where the tables used to be.
At the top of phpMyAdmin you will see Export Import. Just click on that and you will see a screen like this.
Select Browse_ and add you database file and simply click go found below, bottom left.
You will see the browser go in to busy mode, meaning that everything is in process.
Depending on the size of the database it may take some time for this to complete.
Once it is completed you will see a green notification which indicates that it is complete without errors.
If however an error occurs take note of what it says, if it says something like (something was null and couldn’t be created) then you should be ok. Just load click on home found top left and reselect the database you imported too and if its populated you should be good to go.
The reason for the error stating something is null and couldn’t be imported is usually a result of a plugin, or data that cannot be imported, again because possibly someone made a boo boo with their plugins commands to create database tables.
But if you see an error with a specific number, then google it to find out what it means.
Were not quite done yet. Just a few more things to do
Log in to your WordPress dashboard.
The log in will be the same as the site you copied from.
You may notice a message saying update database, just select update then once logged in.
Go to settings:
- Check general settings and ensure that:
WordPress Address (URL) & Site Address (URL) are correct
- Update the Permalinks
Go go settings permalinks and just click save to make sure everything is updated.
- Active the plugins
Go to your file manager in your hosting control panel and find your plugin folder inside wp-content and change its name back to plugins.
Once you have completed all of the above, you should be good to go.
Now you have a copy of your site on a new host or server, once you have done this a few times it will become second nature.
I hope this has helped you out and please don’t forget to sign up to receive updates and the latest posts.