- 1 How to migrate a WordPress site from one server to another
- 1.1 Transferring WordPress site to New Server
Whenever you create a WordPress blog, the main objective is to draw large traffic to monetize the effort. The performance of any blog depends upon various factors such as its appearance, content, domain, SEO, speed etc.
The loading speed of any website is one of major factors affecting its performance. With the increasing traffic on your blog the server could not easily handle it. With increasing traffic you need to make sure that your website server is able to handle that much traffic. Also if your website is older then you may face problem of running out of space with older server. The support from hosting company could be a reason to change server.
If loading speed of a website is longer, then most of the user’s will bounce back. If lot of people visit your website but do not stay for long time then surely it is a reason to worry. The websites with high bounce rate is not beneficial for the website owner. The great loading time on your new server, low cost and 100% uptime are some of features for which most of blogs move on to a new and better host.
How to migrate a WordPress site from one server to another
Transferring your WordPress blog might be very tricky if not followed properly. It usually takes 30-40 minutes to carry out if done properly and now you can enjoy the new experience on your new hosting provider. You should choose a time to carry out transfer when your website doesn’t get much traffic.
Transferring from one server to another can only be effective if all of your data are secure.
Basically, migrating your WordPress blog from one server to another consists of three parts: Moving the wp-content file, moving your database and reconfiguration (if needed).
Note: Make sure to update your wordpress version, themes and plugins to the latest version because you can’t do it during transfer takes place. One should keep their WordPress version updated anyway to keep their site secure and safe from hackers. Make sure to perform some cleanups such that your database and WP-content size is small. It takes time to carry larger file from one location to another location.
You need to carry those files only which you want on your new server. Delete all the unnecessary files that you don’t want to carry like:-
- Extra themes and plug-ins.
- All trash comment, post and spam comments.
- All cache files.
- Previous database backup.
This will reduce your database size smaller hence it will be easier to transfer smaller database .sql file. You can also compress database to Zip, if its size is huge for faster transfer.
Transferring WordPress site to New Server
Now you are ready to transfer your WordPress blog from one server to another by following 6 simple steps that I provided.
Step 1: Backup files and Database
Firstly you have to take a back-up of all the data that you need in your new web server. These data comprises of two parts i.e. – database and WP-Content file.
For WP Content files:- You need to download all your WordPress files from old host. These include files from themes folder and plug-in folders. These files need to be uploaded later on new server.
- If you are using cPanel hosting you can simply login to file manager through cPanel and take a backup of WP-content folder or the entire Home Directory.
- You can use any FTP client such as Filezilla, WS_FTP, Cute FTP, BigDump and Core FTP for easy and fast download of your files.
One thing to note that some of FTP does not download .htaccess file, these files are important to maintain permalinks. You can click on-> view -> show hidden files to download .htaccess
- Make sure to download any folder you are using that is maintained outside of your blog’s folder. For ex. You are using a separate folder Video located outside your blog’s folder than you have to download that too.
For Database – The data on your database need to be exported so that it could link to your website.
phpMyAdmin:- If phpMyAdmin is installed in your device then you can use this method to export file. Login into phpMyAdmin then.
Click on -> database which contain your blog.
Click ->export in top navigation menu then select the ->quick method to export
Choose format as it is i.e. –> .SQL then click on -> go to start exporting files.
Then select the prompt as Save as File
- Commandline:- This method is used when you don’t have phpMyAdmin installed in your device. To start, login into your server via-SSH using tool like puTTy as a user to work with server.
Search for WP-config file for following details: (‘DB_NAME’, ‘database-name’);
/** MySQL database username */
/** MySQL database password */
/** MySQL hostname */
Run this command on your command box: mysqldump –h (host_name) –p (port_number) –u (user_name) –p (database_name) > name_of_backup.sql
You need to enter password to continue. You should fill the variable in brackets with appropriate value and do not include the brackets.
Your database backup will be exported in /html folder. Move it to another directory so that no one can download your database information.
Optional Step: When export is complete compress it to make transfer faster.
Step 2: Install WordPress in the new server
Login to your cPanel and locate any of the following tools: “fantastico” or “softaculous”. Once inside the tool, click on the text that says “WordPress”. The WordPress installation will ask for a few basic things like – where the install it which is usually blank for root directory and some optional questions like site title and admin username, email id etc.
It will take a few seconds to install WordPress and the configuration details will be sent via. Email in the email id you provide during installation.
Step 3: Import WP-Content file
The file you have saved should now be imported on the new server for select folders, like the image folder, themes and plugins folder and any other custom uploads that had been made in the previous server.
- cPanel:-If you have used cPanel hosting then login into cPanel in the File Section click on ->
Under Restore a Home Directory backup click on->choose file and navigate to the location of file you have exported during Step 1. Then click on->Open
Now you see the backup file name, so click on->upload. Now you can see the progress of your files being uploaded.
- FTP Client: Open your FTP client and connect it to your new hosting account. Upload wp-content file (Backup from old host that you took in the first step) – that way you overwrite the files and add the things that was missing in the fresh install.
Step 4: Import the SQL file that was exported from the previous server
- phpMyAdmin:- Firstly login into phphMyAdmin to carry out import. After you logged in-
Click on->database to which you want to import. Then click on ->Import tab at top of page.
In the File to Import section select the SQL based file from your device that you wish to import.
Use partial import if you want to skip no. of code. Use format and format specification left to their default values.
Click->Go to initiate the import. Congratulations! You have successfully imported the database file to your new host.
- Commandline:- As described earlier login into your server via- SSH. Again check for wp-config file to see the details.
Now run this command on command line: – mysql – h (host_name) –p (port_number) -u (username) –p (database name) < path/to/name_of_backup.sql.
You’ll be asked to enter password after entering password import will begin.
Step 5: Edit the WP Configure file
The configuration file – wp-config is stored in root of your WordPress files. Open it and you’ll find the following details, so change the database details to reflect the new database on the new server
// ** My SQL settings – you can get this info from your web host **//
/* the name of the database for wordpress */
define( ‘DB_NAME’, ‘database_name’) ;
/* MySQL database username */
/*MySQL database password */
/** MySQL hostname*/
After doing this now you have edited the database information with new host values.
Step 6: Reconfiguration
Log into your WordPress panel and activate the old themes and the plugins if they aren’t activated automatically. In most cases it is done automatically but if your WordPress blog is not automatically reconfigured then you have to do it manually.
That is pretty much it and everything should be back to how it was in the previous server. The migration may seem very technical stuff to you but if you follow these simple steps then you can do it by own very easily. Now you can enjoy your WordPress blog on your new hosting server with lots of new features and much faster speed. It will take some time, so be patient while this transfer occurs.
Although I have tried to include all the problems that you may face during the transfer of WordPress site from one server to another along with their solution so you don’t have to worry much. But in case you have any then feel free to ask here.
How do you find this post useful? Please share your views in the comments below.