Rehmat Alam A blogger who has fallen in love with coding! Here at, I share things that relate to coding, servers, E-marketing, and other related fields.

How to Move a WordPress Site from One Server to Another Host

5 min read

Over last couple of months, I am wandering here and there for finding a stable hosting provider. After moving my WordPress blog between several hosts, today I thought that my experience might help you in moving a WordPress site to new server as I faced some difficulties in beginning when I wasn’t familiar about how to make this move. So this tutorial will help you if you don’t know how to move your WordPress site to a new hosting provider’s servers by retaining its originality.

Though several hosting providers offer their free migration services and they move your site to their servers when you purchase a hosting plan there. Still it isn’t a good choice as you need to complete several request forms or you need to send a request email to their support for this purpose. It takes time and I don’t like or recommend it all. In addition, a lot of paid migration services are also there but they cost you money. So it is necessary to learn about basic skills like moving your WordPress blog to a new host. Learning and practicing the procedure is a fun as well as it will save you some money too along with time and frustrating delays 🙂

Let’s talk about the procedure for switching between hosting providers. This tutorial is for cPanel users on Linux servers. Though you can use the easier “Complete Backup” option of cPanel to clone a site to a new server, but it migrates all the content and there might be several directories on your server which contain the garbage. So moving only needed content will save you some storage space as well as time. For this purpose, I’m guiding you through a manual process which will clone your WordPress blog to a new server within a few minutes.

Moving WordPress Blog to a New Server

First Step: In first step, you will obviously purchase a new hosting package. After purchasing the hosting, log in to your cPanel on new server and confirm that the hosting provider has activated your account and you can access it.

Second Step: Now log in to cPanel on your old hosting account and then navigate to the root directory of your domain in “File Manager” which is public_html in most cases. There, you will find several directories including wp-admin, wp-content and several others. Select all directories which belong to your blog.


After selecting the files and folders, you need to deselect a file and a directory which are .htaccess file and cgi-bin directory. To deselect these, press and hold Ctrl key and click the file and directory individually.


Step 3: After selecting files and directories in your domain’s root folder, compress them to a new zipped file. Name the zip file as, select zip as format and press “Compress File(s)” button.


Step 4: Once the compressing process completes, a new compressed file ( if you have renamed it) will be created in your domain’s root directory. You can download the (may be with any other name if you haven’t renamed it) file from your website at http://.yoursiteurl/ Download the zipped file and store it on your computer.

Step 5: Now you need to download the backup of your blog’s database as WordPress stores all posts, comments, other text based content and all themes and plugins configuration details in a MySQL database. To download the backup of your database, go to phpMyAdmin. (You can download your database’s backup using cPanel’s backup feature but it sometimes creates bugs during restoration process later on new server)


Step 6: In phpMyAdmin, download a backup of your database. First select your blog’s database from the list on left side panel and then use “Export” feature to download the database backup. Simply download an SQL backup file for your database by pressing “Go” button and don’t configure any compression features to avoid bugs later in restoring the backup on new server.


Step 7: After downloading the backup of your domain’s root directory and blog’s database, now its time to upload the content to your new server. For that purpose, log in to your cPanel on new server and again go to its file manager (domain root directory which is public_html by default). Enable the option for showing hidden files while accessing file manager.

In your domain’s root directory, upload the file which you have downloaded earlier. After uploading the file, decompress its content. All stuff will be extracted to the root directory on new server. To decompress the file, select it and press “Extract” button on tools panel


Step 8: Now you need to edit the .htaccess file on new server. .htaccess file should be visible in root directory of the domain if you have enabled the display of hidden files. If you haven’t enabled this, go back to cPanel and now open “Legacy File Manager” for your domain’s root directory. There, click .htaccess file in Legacy File Manager and on right top, you will find the edit option for the file.


Edit .htaccess file. An editor window will open. Now open cPanel on your old server and edit the .htacess file there with similar method as I mentioned above. Copy all content from old .htaccess file and then replace the content in .htaccess file on new server by pasting the copied content in it. After pasting the content, save the changes and close the editor.

Step 9: You have almost finalized the task. Next, you need to create a MySQL database and then import the database backup which you have downloaded from the old server. To create a new database, go to “MySQL Databases” from cPanel and then create a new database. Name it wpblog or something else according to your choice.


After creating the database, create a user by setting a strong password for it and then add the user to newly created database. To add the user to new database, scroll down the page, you will find the option to add the user to your created database. During adding the user to database, assign all privileges for it.

Remember the username, password and database name accurately. You need to remember the username along with prefix which is something like cpaneluser_. The complete username will be cpaneluser_username and database name will be cpaneluser_wpblog . The values will vary according to your cPanel username and the names you choose for your database and for the user.


Now you need to import the database content from downloaded backup into newly created database. To do so, go to phpMyAdmin again as you did earlier on old server to download the backup of your database. If you have forgotten the process, look above in initial steps for screenshots. In phpMyAdmin, select the recently created database from left sidebar and now go to “Import” tab. In “Import” section, select the earlier downloaded backup file (.sql) by pressing “Choose File” button and then press “Go” button to restore the database content.

Wait till the upload completes. Once the upload is completed, it will restore your all posts, pages, comments and the personalized settings for themes and plugins.

After the upload is complete, go to File Manager again and now edit wp-config.php file. Find the database name, username and password in wp-config.php file and replace the values with newer ones which you have remembered during creating the database and user on new server. After making the changes, save wp-config.php.

Now you have successfully cloned your WordPress blog to a new server on a new hosting provider. Finally, you just need to redirect your domain to the new server by modifying its DNS values from domain’s control panel. Once the DNS is modified and it propagates, visit your URL to view your site. The site will be accessed from the new server with the similar look, content and configurations as it was on the previous server.

You might be thinking that I made this tutorial lengthy, but it is the best way for non-techies to clone a WordPress blog to a new server without facing issues. There are several shortcuts but they bring failure in most cases and you will get frustrated a lot. So this tutorial should help you in comfortably and successfully moving your WordPress site to a new hosting provider. If you are still facing any bugs, let me know in comments or by contacting me via contact form.

Rehmat Alam A blogger who has fallen in love with coding! Here at, I share things that relate to coding, servers, E-marketing, and other related fields.

Linux or Windows Based Hosting Server for WordPress?

Due to its powerful features and user-friendliness, WordPress has become the first choice of bloggers. If you are a blogger and want to start...
Rehmat Alam
2 min read

How to Improve Page Load Time in WordPress

Although both servers and Internet connections in modern world have become robust, still it is believed by SEOs that load time is a part...
Rehmat Alam
3 min read

12 Replies to “How to Move a WordPress Site from One Server…”

  1. Thats too Good Rehmat Bhai 🙂 well written and detail information. i think when i change my hosting then definately it helps me out, God Bless You.
    Keep Looking On my Blog Too 🙂 cheers
    rehmat Bro You have any Blog In Which You Share Your Knowledge Through Video Tutorial about seo and blogging tips ???
    if Any then Share Here I am Always Follow Your Post

    1. Hi Umar, thank you for appreciation 🙂 Yes I keep checking your blog. You are doing good there. Keep it up. Regarding with SEO videos, I’m sorry to say that I don’t have any SEO video blog. I’ll include videos to this blog soon insha’Allah 🙂

  2. Hi Rehmat you done a great job! This article will help a lot for newbies, When i was reading this article some silly questions shaking my mind 😀 the first is why we need to create a new .htaccess file in a new server while it is already in old server? And the second is what is the basic purpose of cgi-bin? Because we are not copying it while taking backup. The major question is how to move data online from one server to another server? If you know please share it with us too. Thanks

    1. Hey Asif, you have raised good questions 🙂
      Your first question regarding .htaccess; yes the file is already on old server but while compressing the content in root directory, .htaccess file may not get included in the compressed package as it is hidden by default. So to ensure that the file’s content is cloned on new server, I have recommended to edit the two files on the servers. It will ensure that non-techie persons also perform the task.

      Moreover, your blog’s .htaccess file contains crucial configuration about your blog like configuration for caching plugins, redirection and much more. So you need to keep it exactly similar on the new server.

      Regarding with cgi-bin directory, it is created by cpanel and it resolves the URL when nothing is uploaded to the directory, i.e. when there isn’t any index.php or index.html file in the directory. So you don’t need it. You just need to move core files that belong to your WP blog.

  3. Rehmat thanks for this tip……
    Dear i wanna start a website i want to ask you that the real earning is really exist wich some website estimate like…………….shows your income like 194 $. I really surprise that if it is true you are a “Rich man” .And i really want to start my website very soon.
    If this is not exist then how many you can earn….just simple explain if they show you are earn 194 $ ,what are the nearest point you earn.I am not asking about your earning just simple how can be earn from a website.Thanks

    1. Hi Amir,
      My daily ad revenue isn’t $194 but yes, the earnings are good 🙂 You should start your website or blog as I consider blogging one of the best ways to earn online.

      1. Yeah. He is right. His earning from this blog is much more than that. 🙂
        By the way, thanks for the tutorial.

        1. Hey Talal, I haven’t reached $194 a day now 🙁 Yes sometimes you earn even more than that but the average isn’t $194. I was promoting HostGator and was earning good with it, but now HostGator’s quality has dropped and I am not promoting it anymore, because I am aiming to provide only quality for my loyal readers 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *