We use cookies
We use cookies to optimize our website. By continuing to browse the site, you agree to our use of cookies.
New design
Control panel
  • Русский
  • Українська
  • English
  • UAH
  • USD
  • RUB
  • EUR
  • 0-800-307-307 Hotline
  • +38 (044) 392-74-33 Kiev
  • +38 (057) 728-39-00 Kharkiv
  • +38 (056) 794-38-31 Dnipro
  • +38 (032) 229-58-93 Lviv
  • +38 (048) 738-57-70 Odessa
  • +38(093) 170-15-42  Life
  • +38 (067) 400-88-44 Kievstar
  • +1(888)393-24-51  USA, Toll free
  • +44(131)507-01-14  Great Britain
  • +7 (499) 348-28-61 Moscow

How to properly transfer your site to another domain

Some users may need to change the domain. There can be many reasons for this, among the most common: renaming a company, changing a domain zone (for example, from .ua to com.ua), trying to get out of the filters (if other options did not give results), and others. As a rule, this procedure is performed by a technical support specialist, but in this article we will help you figure it out on your own. We will provide you with step-by-step instructions on how to transfer your site to another domain, without falling under Google or Yandex filters and retaining your positions in the search results.

Step-by-step instruction

Transferring hosting to another domain takes place in two stages: transferring the database and setting up redirection from the old URL to the new one.

Stage 1: database transfer

This procedure determines whether all the information will be saved and how correctly it will be displayed after the transfer. Therefore, this procedure should be approached as responsibly as possible. If the hosting does not change during the site transfer, you can entrust this task to your hoster and the specialists will transfer the database on their own. Sometimes, the database is tied to the account, in which case you don't have to contact the hoster. When changing a hoster, you need to dump the database.

Let's take an example of how to transfer a site to another domain based on Wordpress.

Back up the database using the hosting tools or the SSH command line:

cd full_path_to_WP # go to the folder with installed Wordpress tar -pczf backup.tar.gz * # Archive all files in the current directory 

After transferring, unzip the resulting archive by writing the command to SSH:

tar -xvfz backup.tar.gz

Export Wordpress tables to SQL.

Import dump.sql into the new database.

Edit wp-config.php in the root directory of the site.

The following lines are subject to replacement:

define(‘DB_NAME’, ‘you_bd_name '); // database name define ('DB_USER’, ‘you_db_user '); // database username define ('DB_PASSWORD’, ‘you_db_password '); // database password define ('DB_HOST’, ‘you_db_host '); // host of the database, most often localhost

The site transfer to another domain is almost complete and can be accessed at the new address. But links in this case may not work correctly, so you need to write a code in phpmyadmin that will replace the old links with the new ones.

UPDATE wp_options SET option_value = replace(option_value, 'http://old.com', 'http://new.com')
UPDATE wp_posts SET guid = replace(guid, 'http://old.com', 'http://new.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://old.com', 'http://new.com');

After the completed procedure, the links should work correctly (including media files and sitemap). If your site has been successfully migrated, you can proceed to the second stage.

Step 2: Set up a redirect from the old URL to the new one

This stage is necessary not only for users, but also for search engines, so that they know about your “move” and there is no longer any point in indexing the old web resource.

The transfer is done as follows: edit the .htaccess file.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^oldsait.com
RewriteRule (.*) http://newsait.com/$1 [R301,L]

Next, you need to inform the search engines about the transition to a new domain (in the webmaster's office)

If the setting is done correctly, the mirrors will stick together within 30 days.

Advice: before transferring the site, be sure to back up the database, which in case of difficulties will help to resume everything.


We offer the best shared hosting for websites on Joomla, Wordpress and others popular CMS with PHP, Perl, MySQL support.

Simply select a domain, order hosting and install the CMS in one click.

Choose the package of services that best suits the needs of your project: SSD hosting, VPS on SSD, Cloud (cloud) hosting, cloud VPS. Dedicated server or dedicated server.

Our technical support, works 24/7/365 and you can always get qualified help if you have any questions.

 

Only registered users can leave comments

Subscribe to the newsletter

We will send announcements of new articles and useful tips once a week

Follow us on social networks