Every now and then there are so many websites which are created and uploaded on the internet. Social Media has taken the internet by storm and its an overflow of information that gets shared and read on the social networks. It’s very easy to create a website with so many instant tools which can help you to put together all the required elements for a good and responsive website. But having a good design is not the only prerequisite to having a website. You need to upload and host your website on a hosting server which will make it available to the world audience via the world wide web.
We are left with a galore of hosting providers marketing on the quality of the servers and the prices competitiveness. Sometimes we do make the right and worthwhile choice but many times we fall prey to many attractive discounts offered by small hosting providers. It is also possible that as our website keeps growing and traffic starts increasing we may have to either go in for an upgrade or even may opt to change our hosting providers to a much better and stable one.
What if you have an existing WordPress site and for some reason, you plan to migrate or change your hosting provider. You might think it to be a hell of a task to shift your entire website which may have garnered good traffics over a period and also you are concerned about the downtimes that may happen while you plan to move your WordPress site. I thought it would be worthwhile to get down to putting an easy step by step procedure which I followed while moving WordPress site to a new hosting provider. Let’s dive in…
STEP 1: Backing up all your essential files. (The most Important of all)
As we start off to take that big step of moving your WordPress site the first and most important part is to create a backup of all the essential WordPress file from your existing hosting server. You can use any good FTP software and I would recommend Filezilla as I have been using it for quite long now. Connect to your web host and copy all your files to a local directory. Do not miss out on any hidden files, in particular, the .htaccess file. It may be hidden by default so please be careful about that.
STEP 2: Export your existing database.
Another important aspect which needs to be diligently followed is the backing up of the database which forms the core of the WordPress website. Your database can be accessed by login to the PHPMyAdmin and once logged in you need to select the database that contains the website. The following options needs to be selected from the PHPMyAdmin screen as
- Export Method – Quick & Custom you can leave it as default being Quick.
- Format – SQL Format
Once selected you can click a GO and the entire database will be downloaded to your local drive as “databsename.sql”.
STEP 3: Create a new hosting Database.
Once the backup procedure has been successful then the next step is to create an environment for your new website hosting. The first and foremost job would be to create the new database at your new hosting space.
- Logging to PHPMyAdmin at your new hosting space or you can use the control panel of your hosting to create a new database.
- Create a new database in SQL preferably by giving the same name as your previous database.
- Create a new username and credentials with access to the new database. This is of top priority as it needs to be used in the later part of the migration.
STEP 4: Control access between WordPress & your Database.
Your WordPress files need to communicate with your database as all the information pertaining to the working of the website exists in your database. Once your database is created and ready you need to edit one essential file wp-config.php which caters to the connectivity with your database.
- I would advise you to make a copy of this file and store it in another directory as to be cautious in case we mess up with the original file.
- Search for a syntax DB_NAME define(‘DB_Name’ , ‘db_name’); and enter the name of the new database.
- Search for a syntax DB_USER define(‘DB_User’ , ‘db_user’); and enter the username which has access to the new database. This username was created by us in our previous steps while creating the new database.
- Search for a syntax DB_PASSWORD define(‘DB_Password’ , db_password’); and enter the password for the above username.
This assures that the WordPress files connects to the newly created database for further communications.
STEP 5: Import your Database from the backup.
It’s all set now for us to import our backed up database. It’s yet another time to visit our PHPMyAdmin and this time from our new hosting server.
- Select your newly created database to which the SQL file has to be imported.
- Select the import button from the screen to proceed to select the SQL file.
- Browse to the location in your local directory where you’re backed up SQL file exists to select the same.
- Uncheck a selection (Partial Import) check box.
- Select the format of the import as SQL.
- Click the (GO) button which will initiate the process of importing the database.
- Once the import is completed you should be getting a prompt message on the screen as “Import successfully finished”.
STEP 6: Upload your WordPress files to new hosting ( Your Backup)
Finally, we come to the last stages of finished the migration and that to copy the backed up WordPress file to the new hosting space.
- As we used the FTP FileZilla to copy all the files from the previous hosting space we will use the same software to connect to the new hosting server.
- Browse to the local directory where you have saved your WordPress files to copy and upload the entire WordPress files to the new hosting server.
- Finally, you have completed the migration of your WordPress website to the newly purchased hosting server.
STEP 7: Your website up and working – Check your Nameservers.
- After we have successfully moved our website to the new hosting space it is also very essential that you check your Nameservers as it has to point to the new hosting server if your website needs to be truly accessible via your Domain Name.
WordPress migration is an easy take but please be careful while taking backups of your existing website. There are many good tools to backup your WordPress website with much ease but I personally like to do it myself.