The domain name is just the address of the project. And often it has to be changed. There are many situations when it may be necessary to transfer the site to another domain without losing traffic: changing the domain zone (for example, from .ua to com.ua), renaming the company, trying to get out of the filters (if other options did not help).
A logical question arises: is it possible to move the site to another domain without losing positions in search results? Of course! And this publication describes in detail how to do it correctly so as not to fall under the filters of Google or Yandex.
How to transfer a site from one domain to another (step-by-step instructions)
Moving the site to another domain is performed in two stages. The first is database migration. This procedure should be approached as responsibly as possible, because two things directly depend on it: whether all available information will be preserved, and how correctly it will be displayed after the move.
If during the transfer the hosting of the site remains the same, this task is performed by the hoster. Just let him know - and the company's employees will transfer the database on their own. And sometimes you don't have to go anywhere, because usually the database is tied to the account.
If you plan to move to another hosting, then a database dump is made (it will be needed later).
For example, consider how to transfer a site from one domain to another based on WordPress:
Back up the database using the tools provided by the host or using the SSH command line:
After transfer, unzip the received archive by entering the following command in SSH:
Export WordPress tables to SQL.
Import dump.sql into the new database.
Make changes to wp-config.php located in the root directory of the site. The lines to be replaced are:
The transfer of the site to another domain is almost complete. It will already be available at the new address, but the links may not work properly. To solve this nuance, you need to write a code in phpmyadmin that replaces old links with new ones:
Links should now work correctly (including media files and sitemap ).
If the site was successfully transferred, proceed to the second stage. In this case, you need to configure redirection from the old URL to the new one. This is necessary not only for users, but also for search engines - so that they know that you have moved, and it is no longer necessary to index the former web resource.
Redirection is configured as follows:
Edit the .htaccess file.
Notify searchers about the move in the webmaster's office.
If the setting is done correctly, the mirrors will stick together for 30 days.
Now you know how to transfer a site to another domain. And you can easily do this procedure yourself, and with the preservation of traffic and sending weight. Just before starting work, be sure to make backup copies of the database. If difficulties arise, you can restore everything.