Transferring your e-commerce project to another web host: how to avoid traffic drops

We will send the material to you by email:

    Время чтения: 7 мин.

    It happens that e-commerce projects grow and develop, hosting requirements change, and at some point a decision is made to move to another provider. At the same time, there are a number of concerns about traffic after the move, they say, it can noticeably subside. In this article, we will consider the option of safely transferring a site to another hosting without losing traffic.

    The main stages of site transfer

    To move an e-commerce project, it is important to follow the following procedure:

    • Copying files and database to a computer from the old hosting
    • Uploading data to a new hosting
    • Editing Configuration Files
    • Site performance testing
    • Changing NS servers at a domain name registrar

    The zero stage is not indicated here – this is the choice of a new hosting. Before moving a site, you should make sure that your new hosting is actually better than the previous one, and not from advertising prospectuses. Quality hosting can be defined by a long service life, and if you are interested in this topic, then information on it can be found here. Agree, it is not at all rational to start such work, and as a result, get a worse result than it was.

    How to copy files and database correctly

    Your e-commerce site consists of two parts: files and a database. Most of the popular content management systems work with MySQL database. Do not try to copy files using FTP managers such as FileZilla or Total Commander. Any CMS contains hundreds and thousands of files, copying which will take more than one hour, regardless of the speed of the Internet. This is due to the slow processing of requests via the FTP protocol, due to which more time is spent requesting each file.

    It is much more efficient to archive the root folder of the site and copy one archive file to the computer. In some content management systems, for example, ISP Manager, before highlighting files, you need to go to the settings and enable the display of hidden files. Otherwise, important system files such as “.htaccess” will not be archived and will need to be copied manually (if you know what files are needed).

    The second nuance: do not archive the root folder itself, which may be called “” or “public_html”, but add the contents of this folder to the archive. Thus, you will be able to unzip the files directly to the root folder on the new hosting, the name of which may differ. Otherwise, you will have to do an extra operation – transfer files one folder level higher.

    You can transfer a database in two ways:

    • Using the “Download database” function, which is not present in all control systems, such as in ISP Manager
    • Using the “phpMyAdmin” tool

    We do not recommend the first method, because. it only works properly between similar MySQL server versions. If the new hosting has a different version of the server, then you will probably encounter a database loading error, the correction of which will require the involvement of a specialist. It is much better to run the “phpMyAdmin” utility, which is present in all control panels. Next, select the database and do “Export” in “SQL” format with default settings.

    On a new hosting, you need to do the reverse operation. Create a new empty database, open “phpMyAdmin” and “Import” the dumped database with default settings. Sometimes, incompatibilities do arise, in which case it’s best to ask your hosting tech support to import your “.sql” file.

    If you have an online store with a large database, then there may be a situation with limiting the maximum possible file size for uploading or downloading. Usually, this limit is quite large and is, for example, 128MB. If your database is larger, then you also need to create a ticket in the hosting help system with a request to upload/download the database.

    Site config files

    Hostings run on different web servers, the most popular being Apache and nGinx. The web server processes requests from the visitor’s browser and sends him ready-made HTML pages, pictures, scripts, etc. When migrating a site, it is important that the old and new hosts have the same web server. Otherwise, you will need to hire a specialist to transfer the current settings to another web server.

    Even if the software is the same, you need to open the configuration files “.htaccess” for Apache, or “nginx.conf” for nGinx and check if there are absolute paths to the files on the server. Leave the relative paths as they are, but you need to change the absolute paths to new ones, because. the server’s internal folder hierarchy will be different. Also, some previously used functions may stop working. You will need to carefully check the operation of the site, matching server response headers, redirects, etc. Don’t forget to change the database name, MySQL login and password.

    Absolute paths are specified in the settings of some plugins, they will also need to be changed. It’s a bit more complicated, because you need to know where they are used. Fortunately, this rarely happens. For example, the Hyper Cache caching plugin in CMS WordPress writes an absolute path in the configuration file. On a new host, caching simply won’t work until the plugin is reactivated. It’s hard to notice without deliberate checking.

    Two more important points: PHP version and SSL certificate. On the old hosting, your site was tuned to a specific version of the PHP interpreter. If it was version 7.0, and the new location is set to 7.4 by default, then the site may stop working. The same will happen if the necessary PHP modules are disabled. In this case, you need to ask technical support to enable the appropriate PHP version and modules. All that remains is to import the existing SSL certificate or enable the receipt of a new free certificate.

    How not to lose traffic when moving

    Traffic can be lost in two cases:

    • All traffic disappears. site doesn’t work at all
    • Incompatibility of the old configuration with the new software, as a result of which some types of pages do not work

    This can be easily avoided if you make sure in advance that the site works like clockwork. By default, the guides for migrating a site to a new hosting indicate that you need to change the NS servers to new ones at the domain name registrar. As a result, the site will be completely transferred to the service of a new hosting provider within 4-24 hours. If something goes wrong, it will take the same amount to cancel the operation, and the site will be down for at least 8 hours!

    There is a safe option for testing the site:

    • On Windows, open the file “C:\Windows\System32\drivers\etc\hosts”
    • Add the line “ip_address site_name” to the end of the file

    “IP_address” is the IP address of the new hosting server, and “site_name” must be entered without “http://”, for example, “”. Save the “hosts” file and open your e-commerce website in a new tab in incognito mode. Now it works on a new hosting, or it does not work … You can test it “both in the tail and in the mane”. To make sure everything worked and you see the site from the new server, install the Google Chrome extension called Website IP. In the lower right corner, the IP of the server from which the site is loaded will be displayed.

    Only after you are sure that everything is working, you can go to the personal account of the domain name registrar and change the NS servers. Rest assured, the site will move without a single downtime and loss of traffic.

    5/5 - (1 vote)