Changing hosting is a common procedure that accompanies the maintenance and development of an Internet resource. Not only can an experienced web admin do the transfer of databases and configuration files. There are FTP clients for copying data to the hosting server, either as third-party programs or as features embedded in the hosting control panel (ISP Manager). With their help, even a user who is not involved in the development process can independently deploy the website to a new hosting provider. You may find out how to move the website to another hosting using them in our article.
There are always plenty of reasons to move to new hosting. The most frequent sources of motivation include:
The cost of leasing current hosting is too high;
Low data download speed;
Frequent server crashes (500 – Internal Server Error);
Lack of sane tech support;
Insecurity against viral attacks.
If the site was created on a local server, it needs more bandwidth and processing power to operate in the public domain. It is reasonable to move the site from the local server to a large-resource hosting provider to improve request processing speed and handle greater data volume. These needs can be met by renting a dedicated server.
It is important to keep the domain name of your site in terms of search engine optimization. Its loss is fraught with loss of position in search engine results. To keep your domain after changing hosting, you need to update the NS records in the site registrar's control panel. Follow the instructions below:
Log in to your account at the domain name registrar site.
Select the desired domain, if you have more than one.
Select "DNS Server Settings".
Enter fresh NS records.
In the hosting control panel, select "Add domain" and enter its name.
It usually takes 2 to 24 hours to update your DNS information, depending on your ISP's workload. We recommend that you do not make any changes to the site during this period, as they may be lost after registration.
To preserve the functionality and information content of the resource at the new location, migration is carried out:
CSS files containing PHP and jаvascript scripts;
CMS templates and interpreter;
HTML documents and MySQL databases.
Site content in HTML can be copied to the root folder of the hosting directly through an FTP client. They do not require transferring and configuring SQL databases and CSS interpreters. An index.html file is required in the data folder for the page to run.
Websites with CMS shells, Joomla, and WordPress, are easily transferred to most hosting companies. The popular reg.ru registrar, for example, offers hosting services in which these designers are already integrated. Things are more complicated with the old means of development. Transfer site constructor to another hosting is not possible if it is developed on uCoz, Weebly, Jimdo.
The transfer process consists of the following steps
1) Dump (backup) of database and CMS editor files is created.
2) They are uploaded to the new hosting.
3) Rewrote local links in the database using the full name of the site, and corrected the NS records on the domain registrar site.
4) Edits are made to the configuration file.
In the example of a WordPress site, the transfer takes place in this order:
1) Creates a copy of the database through the PHPMyAdmin service. The resulting SQL file is saved to the working computer.
2) Work files are archived and transferred in compressed form to the root directory of the hosting via FTP connection. Then the files are unpacked through the hosting console.
3) In the control panel of hosting, a clean MySQL database is created.
4) Performs import from the saved database into the new one through PHPMyAdmin while saving the encoding parameters.
5) Configuration file (wp-config.php in WordPress)
6) In your personal account on the domain management site, edit NS-settings following those received from the hosting provider.
To transfer engine files and media data, we recommend using free FTP client FileZilla. Proper site migration will require preliminary zip-archiving of files before sending them via FTP client. This is done to avoid data loss during low-speed connections.
The sequence of operations is as follows:
1) In the new FTP connection dialogue box, enter its name.
2) Specify the server IP address, login, and password for login to hosting from your registration data.
3) Tap the "Connect" button.
4) Copy the archive with files to the root folder of the domain.
5) Extract files from the archive in the hosting control panel. In hosting with SSH support, this function can be done via the command line.
Moving a database from a host that is already in use takes several steps:
1) Open PHPMyAdmin in your hosting control panel.
2) Tick the required databases in the list and go to the "Export" tab. Check "SQL" and "qzip archiving" there and save the database in the archived forum.
3) Log in to your new hosting account.
4) In the root folder of the configuration file config.php, type in the new hosting dаta: server name, login, and password for the database.
5) Open PHPMyAdmin and go to the "Structure" tab. There, mark and delete all other files and tables to avoid errors when copying the saved database.
6) Open the "Import" tab and transfer your database. Restore the original encoding if it was changed.
7) Set the permission to split the import process when approaching the limit.
8) Set the import format to SQL and the compatibility mode to ANSI.
9) Click "OK".
In the case of local servers, database files will be available in C:\WebServers\usr\local\mysqlN\data\ when using Denwer. When working with OpenServer, MySQL data is located in C:\OpenServer\userdata\MySQL-x.x.xx. Database migration from Denver to hosting is also performed through PHPMyAdmin. For login in the address, line is written http://localhost/Tools/phpMyAdmin/ или http://127.0.0.1/Tools/phpMyAdmin/.
Mandatory edits to the PHP configuration files should include specifying the following values:
of the database name;
database login and password;
the name of the server where it is stored
In the example of WordPress sites, the configuration file wp-config.php should be edited like this:
define('DB_NAME', 'Your name for the database');
define('DB_USER', 'Database username');
define('DB_PASSWORD', 'Database password');
define('DB_HOST', 'Hosting name').
The working panel of hosting provides for setting different access rights for users. Usually, they are marked by numeric codes and correspond to a specific set of file manipulations: reading, writing, execution, etc. In the access settings, several categories can be set up. Standardly, there are 3 categories: owner, user group, and others.
It is highly desirable to check the performance of the site on the new hosting by a temporary link before attaching the domain. To do this, open the hosts file at C:{WINDOWS\system32\drivers\etc\hosts. It is entered through the gap: the server's IP address, your site's domain name, and its variation with the prefix www. Now, when you enter the domain in your browser, you will be redirected to the new hosting, and you can evaluate the stability of the work.
The most common problem is an error when navigating through internal sections of the site (windows open with error 404). It occurs because links in the database and configuration file are spelt incorrectly (by default, they start with http://localhost). To fix it in the database, the text content http://localhost is replaced by the hosting domain name.
The peculiarity of sites of constructors like Wix and Ucoz is that their domain and hosting are not separable. Only transferring from one hosting service to another is possible. Therefore, when choosing such platforms for creating websites, note that your options will be limited, especially for promotional tools. The designer may not support the installation of additional feedback forms or subscription to e-mail newsletter.