Transfer to another domain. Domain change algorithm without losing positions. File and database transfer

Friends, good afternoon!

Just today I would like to tell you about how the transfer of a domain to another hosting is carried out.

Interesting, why is this happening? And there are actually many reasons, one of them is simply not satisfied with the quality of the services provided.

The presence of reasons already allows you to think about moving.

In the article you will find detailed description steps for moving a domain, so learn and apply.

Action plan to follow:

And now in more detail on each item.

Hosting registration

Registration steps are standard. You won't spend much time. Read useful articles that are already on the blog:

Deleting a domain

Everything is very simple here. This procedure is performed in a few mouse clicks.

On this occasion, there is already on my blog.

Domain transfer

Link the domain to the new hosting - go to the control panel and then to the "Add domain" item. Enter your domain in the appropriate field.

Change the DNS server (NS records). The DNS server needs to be changed, because it indicates on which server on the Internet your site is stored.

If you registered a domain on the site of the old hosting, then you should contact its support service with a request to change NS records.

In case you bought it directly from a name registrar (for example, Reg.ru or WebNames.ru ) do the following:

  1. Log in to your account at the domain registrar service,
  2. Select the desired domain if you have more than one
  3. Click on "Manage DNS Servers";
  4. update NS-records with new ones (you can find them in the new hosting support).

Binding can last several hours (and generally up to 72 hours, but usually about 4-8 hours).

Transferring files of an Internet resource

Follow the steps below:

  1. Install and open an FTP client program (such as FileZilla). And create a new FTP connection ();
  2. In the FTP Connection Setup pop-up window, enter a name for the connection;
  3. In the "Server[:Port]" field, enter the address of the FTP server, the data is sent during hosting registration.
  4. Enter your username and password and click - OK;
  5. Then on the "Connect" button for the newly created connection;
  6. A window will open in which go to the domain.
  7. Copy all files from the old hosting and paste them on the new one.
  8. Write the new database username and password in the config.php file.

You can find more detailed instructions on this in the article about.

Database transfer

To translate a database, follow these steps:

  1. log into phpMyadmin of the old hosting, the link should be in the control panel;
  2. select the database and go to "Export";
  3. on the export panel, select the radio button in the SQL field;
  4. select the SQL-ANSI compatibility mode;
  5. set the switch in the qzip field;
  6. click on the "Save as file" button;
  7. log in to the new hosting account to create a database;
  8. remember the login and password to enter the database (they will need to be specified in the config.php file);
  9. go to phpMyadmin, and then to the "Structure" section;
  10. mark and delete the existing tables so that no errors occur when importing the database;
  11. go to "Import" and transfer the previously saved database, set the previous encoding;
  12. set the switch in the "Allow the script to break the import process when the limit is approaching" field;
  13. select the import file format - SQL, and then the compatibility mode - ANSI;
  14. click OK.

Instructions may vary slightly depending on the hosting you use.

You see, it's not that difficult, just put in a little effort and time.

If you have learned only the most useful from the article, subscribe to blog updates, and do not forget to recommend reading to friends and acquaintances, for example, in in social networks.

Bye everyone and see you soon!

Sincerely! Abdullin Ruslan

This topic is written up and down on the Internet. Information is just a sea. I will try to combine the whole process of transferring the site into one material. What would be convenient to use as a note :) Setting up 301 errors and actually the redirect itself is suitable for any site. And as CMS, in the example I will use WordPress.

Details below.

So the first thing you need to think about is moving your site before you sell or deactivate your old domain. Since the search engines will need to be told that the site has moved. Of course, this can be done in the webmaster panel of any search engine, but I try to start this process at least a couple of months before the complete move. Firstly, for those links that work on social networks or on some other sites, a redirect will work. As a result, the user will be able to get to your new site. Secondly, this way there will be more chances that your new domain will receive the same indicators as the old one.

What I will describe below is suitable for those cases when you need to change not only Domain name, and the entire structure and links will remain the same.

It is conditionally possible to divide the entire migration process into several parts:

  • Transfer of the site itself (engine, database)
  • Creating the right redirect (301st error)

Let's start with the process of transferring the files of the site itself, and then technical part correct redirect. The process of moving a site to another domain is very similar to moving a site from a local machine to a web server. The actions are almost identical.

Transferring site files and directories to another hosting

Since I have already written about the popular one more than once, let's take it as an example.
For this we need the following:

  • to transfer files and directories
  • to create a database dump

With FileZilla you need transfer all files from old domain to new . Create database for a site on a new hosting. (You can read how to do this for WordPress.)

In order to transfer the database, you can use the utility Sypex Dumper, or utility phpMyAdmin. Importing the database to the new hosting. Now it remains to be done additional settings the Wrodpress engine itself.

First you need connect new database to wordpress.
In the wp-config.php file, which is located in the root directory of the new site, you need to change the following lines according to your settings:

/** Database name for WordPress */ define("DB_NAME" , "newsitebdname" ) ; /** MySQL username */ define("DB_USER" , "newsiteusername" ) ; /** MySQL user password */ define("DB_PASSWORD" , "password" ) ; /** MySQL server address */ define("DB_HOST" , "localhost" ) ; /** Database encoding when creating tables. */ define("DB_CHARSET" , "utf8" ) ; /** Mapping schema. Don't change if you're not sure. */ define("DB_COLLATE" , "" ) ;

/** Database name for WordPress */ define("DB_NAME", "newsitebdname"); /** MySQL username */ define("DB_USER", "newsiteusername"); /** MySQL user password */ define("DB_PASSWORD", "password"); /** MySQL server address */ define("DB_HOST", "localhost"); /** Database encoding when creating tables. */ define("DB_CHARSET", "utf8"); /** Mapping schema. Don't change if you're not sure. */ define("DB_COLLATE", "");

This can be done by changing the link in the engine settings. To do this, you need to go to the old site in Options->General, and there fix two fields WordPress Address (URL) and Website address (URL) to the new domain.
I wouldn't recommend this method, as it may still cause some difficulties with links working. And not always even a simple user can understand what needs to be done. The following two options are most preferable.

1. When creating a database dump, for example, through phpMyAdmin, you will get text file. Open it in a text or PHP editor, and select the menu item " Search and Replace" or " Replacing all occurrences«.
2. The second option. Here you will need to execute three MySQL queries that will correct all links, including those that are in the text of your posts. AT phpMyAdmin there is a SQL tab in which you can execute the following three queries:

#Replace the same fields that I mentioned above: WordPress Address (URL) and Site Address (URL) UPDATE wp_options SET option_value = replace (option_value, "http://domain.com" , "http://newdomain.com" ) WHERE option_name = "home" OR option_name = "siteurl" ; #Replace all page addresses with new ones UPDATE wp_posts SET guid = replace (guid, "http://domain.com" , "http://newdomain.com" ) ; #Replace all links that are in the text of posts with new ones UPDATE wp_posts SET post_content = replace (post_content, "http://domain.com" , "http://newdomain.com" ) ;

#Replace the same fields I mentioned above: WordPress Address (URL) and Site Address (URL) UPDATE wp_options SET option_value = replace(option_value, "http://domain.com","http://newdomain.com ") WHERE option_name = "home" OR option_name = "siteurl"; #Replace all page addresses with new ones UPDATE wp_posts SET guid = replace(guid, "http://domain.com","http://newdomain.com"); #Replace all links that are in the text of the posts with new UPDATE wp_posts SET post_content = replace(post_content, "http://domain.com","http://newdomain.com");

Be careful if all your links start with www(http://www.domain.com), then accordingly in the requests you need to indicate this. If you do not know exactly what links you have, then simply enter each of the requests twice: one with www, the other without.

I always use the second method, because it is the fastest, easiest, most convenient, and it seems to me the most correct.

If you used my material and installed the plugin Google XML Sitemaps. Then you will need rebuild the sitemap to change links. The corresponding button (link) is in the plugin settings.
Don't forget to remove the database dump utility and the dump itself.
This completes the site transfer. It remains to configure everything so that all the indicators of your site remain the same.

301 redirect

When changing the domain of the site, its position in the search results and the number of indexed pages may decrease. But in order to minimize this effect, you need to make the right redirect and specify the main site mirror.
Who doesn't know what is 301 Moved Permanently, a little reference:

If, upon request of any page, error 301, this means that the site has permanently moved to a new URI, which is indicated in the Location field of the HTTP header. As a result, users and search engines, when visiting the old URL, will go to the new site.

Error 301 probably one of the most better ways to move to a new domain. After all, this will in fact gluing old and new addresses. And all properties will be transferred from the old to the new, as a result of which your attendance and all indicators of the type TCI and PageRank(PR) and page weight will be transferred to the new domain.

So, in order for the redirect to work, on the old domain in the root directory you need create .htaccess file, with the following content:

Options + FollowSymLinks RewriteEngine on RewriteCond % ( REQUEST_FILENAME) robots. txt$ [ NC] RewriteRule ^([ ^/ ] + ) $1 [ L] RewriteCond % ( HTTP_HOST) ^domain\. com RewriteRule ^(.* ) $ http://newdomain.com/$1 RewriteCond % ( HTTP_HOST) ^www. domain\. com RewriteRule ^(.* ) $http: //www.newdomain.com/$1

Options +FollowSymLinks RewriteEngine on RewriteCond %(REQUEST_FILENAME) robots.txt$ RewriteRule ^([^/]+) $1 [L] RewriteCond %(HTTP_HOST) ^domain\.com RewriteRule ^(.*)$ http://newdomain. com/$1 RewriteCond %(HTTP_HOST) ^www.domain\.com RewriteRule ^(.*)$ http://www.newdomain.com/$1

After that, all users and search robots will be redirected from the domain.com domain to newdomain.com and www.newdomain.com, respectively. And the robots.txt file will be available to search engines in full.
Create and host on the old domain robots.txt file, with the following content:

User-agent: Yandex Host: newdomain. com User-agent: * Disallow: Sitemap: http://newdomain.com/sitemap.xml

User-agent: Yandex Host: newdomain.com User-agent: * Disallow: Sitemap: http://newdomain.com/sitemap.xml

Don't forget to change robots.txt file and on the new domain. This completes the site migration to the new domain. It remains to wait a while, and the search engines themselves will indicate the new domain in the settings of the old one. To be sure, you can manually in all services in the field "Main / main mirror" specify the address of the new domain. This is usually done in webmaster panels search engines google and yandex, and all different directories.
But in the example Yandex just the right file robots.txt for gluing mirrors. And I spoke to him above. The main rule here: do not get confused and specify the new site address in the Host directive and other places. So that the search robot does not mess up anything and indicates what you want as the main / main mirror.

If you use the site visit counter from the service liveinternet.ru, you will need to go to description settings and there in the field "Synonyms" enter the new address of your site. These are the very "mirrors" of the site.

Be prepared for the fact that the old site will disappear from the search results.

And here are some useful links, including sources of information:

  • link - Google recommendations for moving to a new domain
  • link - and here are Yandex recommendations
  • link - here are options for different languages ​​and servers

The material is written based on this post.
Good luck with your travels;) And be careful!

Attention! In 99% of cases, when a site moves to a new domain, it completely or partially falls out of the search results (for 1-2 months). Therefore, before changing a domain name, think very carefully, weighing all the pros and cons. And we will tell you how to minimize the loss of traffic and the main indicators of the site.

Important! The first few months (maximum - up to six) after moving to a new domain, leave the site working on the old domain - do not delete it immediately. Therefore, plan to move to another domain about six months before the expiration date of the current domain. This will facilitate the adaptation of users, and links to the old site may remain on other resources that users will follow.

When will the new site appear in the search results and in what positions?

It will appear in about a month and a half (both in Yandex and Google). Positions usually return to their previous levels, but over time (from 2 weeks to several months). But all this is subject to the correct relocation.

Will the TIC and PR indicators return after the site transfer?

If you do everything right, they will return. Yandex usually returns the TIC in 1.5 months, while Google has it in 2 to 12 months (depending on how often PageRank is updated).

If I buy a used domain, will this affect the move?

The most important thing is that the domain is not on any black lists, blocked by the registrar due to a violation of its policy (posting prohibited content, SPAM, etc.). It is advisable to buy a domain that has been used in a similar field of activity as yours. But keep in mind that if you bought a ready-made site and uploaded new content to it, it will be re-indexed, that is, positions in the search engine are lost. If you bought a ready-made site and change the content gradually, this can save you from a sharp loss of position in search engines. If the domain name is perfect for your project, but it hasn't been used for a long time, don't worry, buy it. After all, all indicators can be returned in a fairly short time.

By the way, with the help of the web archive you can check the history search queries domain. We highly recommend doing this before purchasing.

How to move to a new domain?

1. Choose and buy a domain

We have prepared tips for choosing a domain . If you decide to change hosting, then you will find tips on choosing it. After the purchase, you need to upload an exact copy of the old site to the new domain. At this stage, the problem often arises that some links instead of a relative path (/section/page1.html) are written as an absolute path (for example, http://oldsite.info/razdel/page1.html). Such links will constantly return the user to the old site (if it is working), which the search robot will not like very much when scanning.

This issue can be resolved in two ways:

  1. manually change the links (to find them you can use free program Xenu Link Sleuth), but if your site has hundreds of pages, then the replacement process will turn into a torment.
  2. before uploading the database to a new domain, open it text editor(it is advisable to use Notepad++ so as not to break the encoding), and using autocorrect, change the old site name to a new one (in our example, we are looking for - oldsite.info, we change to - mysite.com).

After that, we check for operability of several links manually, and the rest - by reusing Xenu Links Sleuth.

2. The need to change the design

If you want to change not only the domain name (move from oldsite.info.info to mysite.com), but also change the design of the site or its structure, then it is better to break it down into 2 stages. Those. first move to a new domain, and after a while (about a few months) change the design of the site.

3. Redirect users to a new domain

The move itself consists in automatically redirecting users from all pages of the old site to the corresponding pages of the new site. Moreover, you can’t just take and redirect all visitors only to home page new site. Be sure to redirect from one page to another. Correct example: from the old page http://oldsite.info/section/page1.html redirect to new page http://mysite.com/section/page1.html. To do this automatically, you need to write the following lines in the .htaccess file on the old site:

Options +FollowSymLinks
Rewrite Engine on
RewriteCond %(REQUEST_FILENAME) robots.txt$
RewriteRule ^([^/]+) $1 [L]

RewriteCond %(HTTP_HOST) ^site\.com
RewriteRule ^(.*)$ http://site.org/$1
RewriteCond %(HTTP_HOST) ^www.site\.com
RewriteRule ^(.*)$ http://site.org/$1

Moreover, this code takes into account the fact that visitors can enter the address of the old site both with www and without it. Either way, you will be redirected to the new site. After installing the code, be sure to check if the redirect from the old site to the new one is correct (check not only the main one, but also several pages from different sections).

4. Set up the robots.txt file

In the robots.txt file (both on the old site and on the new one) add new line(or replace the current one):

Sitemap: http://mysite.com/sitemap.xml

where http://mysite.com/sitemap.xml is the path to the xml map of the new site.

5. Waiting for search engines to glue domains

Be patient and don't panic the moment your site drops out of search for a month or more. If you did everything right, then your site will definitely return to the search results. If, after 2 months, your site is still missing in the search, then ask a question on the Google webmaster forum or write to Platon Schukin ( technical support Yandex). To do this, go to Yandex Webmaster, then "My Sites" and select your site from the list. After that, in the lower right corner, click "Ask a question about the support site".

How to glue sites in Google?

This search engine, in order to glue two sites with the same content and replace the old site with a new one in the search results, requires the following:

  • add both sites to Webmaster Tools(IDV)
  • confirm rights to them (this is done in IDV)
  • send a new site for scanning (how to do it) and wait for it to complete
  • it's also a good idea to tell Google that your site is moving (how to do it)
  • upload to IDV sitemap file for a new site
  • set a 301 redirect (we described how to do this in paragraph 3)

Taking part in Google's online meeting with webmasters, we managed to find out one more thing that can be useful and helps to minimize the time of merging sites and being absent from search results. Approximately 2 weeks before the move, on each page of the old site, between the tags, you need to place the rel="canonical" attribute, which will point to a page with identical content on the new site. This attribute tells the search engine that there are two pages with the same content and points to the most important (canonical) page, in your opinion, which Google should show in its SERP. You can do this either manually by placing the following line on each page of the old site:

where http://mysite.com/page1.html is the address of the page of the new site, the content of which is identical to the page of the old site.

If you have a lot of pages and the site works on CMS, then find the file in which all pages are formed and insert the following line between the tags:

"/>

It will automatically substitute the name of the current page and generate the correct link. But do not forget to make sure that the url of the old and new pages match. For example, the old page is http://oldsite.info/section/page1.html and the new page is http://mysite.com/section/page1.html.

How to glue sites in Yandex

This search engine has a simple list of requirements:

  • add both sites to Yandex Webmaster and confirm the rights to them
  • robots.txt files on the old and new site must be identical
  • set a 301 redirect (we described how to do this in paragraph 3) or in the robots.txt file, specify the address of the new site in the Host directive

This moment is very important, and it is worth paying special attention to it. For Yandex, these two methods are equivalent (301 redirect and Host directive), and we have verified that you can choose any of them to move to a new domain. The only difference is that a 301 redirect will immediately start redirecting visitors from the old site to the new one and, thereby, inform all search engines that the site has moved to a new domain and needs to be replaced in the search results. And the Host directive will indicate that only Yandex will move, and besides, your visitors will still go to the old site.

Webmasters use this opportunity if they do not want to risk everything at once. Those. they write the Host directive, and the old site still works as before. After a week or two, Yandex will throw the old site out of the search and after the same time add a new one there. But unlike a 301 redirect, which would cause the old site to drop out of all search engines, the Host directive makes the site drop out only from Yandex. This method has, of course, one drawback. When a new site appears in Yandex, Google will still have the old one, and you still have to use a 301 redirect.

If you still decide to use the Host directive, then in the robots.txt files (on both sites) write the following:

where mysite.com is the address of the new site.

Good day, dear readers! In touch Artem Gubtor
The blog you are visiting now was originally based on the agubtor.ru domain. But I decided to merge my two sites and Artem Gubtor's blog had to be transferred to a new domain. I wrote about how this happened in the article "".

In fact, the desire to change the domain happens to many site owners. And the most savvy people understand that if you just buy a new domain and place the site on it, then the position of the project, attendance and everything acquired by overwork will go to the bottom.

In this article, we will talk about the best way to move to a new domain, what important points to consider when doing so, and how this will affect your project.

Why are sites generally transferred from old addresses to new ones? The reasons may be different, here are a few of them:
1. Need a more relevant domain.
2. The company changed its name.
3. The desire to have a significant top-level domain.
4. Changing the domain zone to a more preferable one (for example, domain.com moves to.ru).
5. You need to enable the HTTPS security protocol

Yandex itself reports that when sites move to another domain, the position of the site may change, in addition, the number of pages indexed by Yandex may change.
However, such changes will be minimal if the new site domain is the main mirror of the old one. This was reported in Yandex.Webmaster.

Quote from Yandex.Webmaster

It is possible that when you move the site to a new domain name, you will lose positions or even fly out of the search engine index; indicators of TIC and PR will fall.

But, if everything is done correctly, then in just a month everything will be as before.

To transfer all the merits of the old site to the new domain name, you need to glue the domains together with a 301 redirect.
If after two months your resource is not in the search, then feel free to write to Google.Webmaster or Yandex technical support. To do this, in Yandex.Webmaster, go to the "Feedback" -> "Change site address, mirrors" -> "Change address and protocol" section, select " Site domain name changed”, at the end click on the link “After a month and a half, the site address has not changed.” Fill out the form that appears:

If you are not afraid of such changes and temporary failures of site indicators, then go for it! Just do everything consistently and competently.
Transferring a site from one domain to another consists in redirecting those who came to the pages of the old domain to the same pages, only with a different domain name.

1. You need to set up and test a 301 redirect for all pages, videos, pictures, and everything else from the old domain to the new one.
This is very simple, in the .htaccess file on the old address from which you will redirect visitors, paste this code:

Options +FollowSymLinks RewriteEngine on Rewrite Engine off

This rule excludes the robots.txt file from the redirect, thus referring to the file, Yandex will understand that the host has changed.
After that, we write the redirect itself:

RewriteCond %(HTTP_HOST) ^sitename\.com RewriteRule ^(.*)$ http://sitename.org/$1 RewriteCond %(HTTP_HOST) ^www.sitename\.com RewriteRule ^(.*)$ http://sitename .org/$1

Be sure to check if everything works. I recommend checking whether the main page and internal pages of the resource are redirected.
2. All external links from other resources that lead to the old site must be corrected so that they go to the address of the new domain name.
3. Do everything as Yandex and Google Webmasters say.

Terms for Yandex.Webmaster:

  • Add both domains to Yandex.Webmaster and verify their ownership.
  • On the old domain, the robots.txt file must be identical to the file on the new address. Don't forget to specify the new domain as the main mirror in this file for Host, or put a 301 redirect.
  • Use the Site Move tool. So you can tell Yandex about changing the domain, protocol (HTTP / HTTPS), select the desired display of the site in the search engine results - with or without www.

For Google:

  • Add your site to Webmaster Tools. I advise you to add 4 addresses - 2 with www and 2 without www.
  • The rights to both sites must be confirmed.
  • Scan the site on the new domain.
  • Let Google know that you're moving your site to another domain.
  • Upload the sitemap.xml of the new domain in Google Webmaster Tools.
    Set up gluing mirrors with a 301 redirect.

That's all! Now it remains only to monitor the performance of the site on the new domain. Over time, the old site will leave the index, and the new one will return its positions.
If you did everything according to the instructions, then changes in indicators will be painless for your site.
If you still have doubts or uncertainty about the ability to transfer your site to a new domain correctly, you can use my services. Write to me - let's make a deal!

You will need

  • - access to the administrative panel of the site's CMS;
  • - access to the control panel of the hosting account on which the site is located;
  • - access to the control panel of the domain to which the site will be transferred;
  • - Internet access;
  • - modern browser;
  • - ftp client program;
  • - optional: access to the site server via SSH protocol, SSH client.

Instruction

Place a notice on the site about the upcoming transfer. Specify the domain to which the site will be moved, as well as the date and time when the corresponding work will be performed. It is worth posting a notice a few days before the actual change of address. This will allow more users to see the information about the transfer, as well as create a margin of time needed to delegate the new domain.

Add the domain to which the site will be transferred to the list of hosting account domains. This can be done in the control panel. As a result, an appropriate directory structure will be created on the server, records about the domain will be added to the DNS server, and the domain will be included in the supported hosts of the http server.

Change the list of DNS servers for the new domain. Find out the addresses of the DNS servers serving the server where the site is located. Typically, this information is provided on the hoster's website, or in the hosting account control panel. Go to the control panel (located on the website of the registrar or reseller). Change the list of DNS servers. Save your changes.

Wait for the delegation of the domain with the new list of DNS servers. As a rule, the change of information on the root DNS servers of the zone occurs once every 6-8 hours. It may also take time to update information on your ISP's caching DNS servers.

Make sure that the software can access the server hosting the site using HTTP. To do this, place a test html file in the folder that is the root directory of the site and load it in the browser.

Start moving your site to a new domain. Restrict access to directory structures matching and new with basic authorization. Disable chron jobs. Make backup copies of databases and website files.

Move the site. Copy or move all site files from the directory corresponding to the old domain to the directory corresponding to the new domain, keeping the directory structure intact. It is convenient to do this by connecting to the server via SSH. If this is not possible, copy the files to your local computer via FTP, and then upload them via FTP from your local computer to a new folder on the server. This may require you to set file and folder permissions according to their values ​​in the old directory. Correct the CMS configuration files to match its new location on the server. Go to the site's admin panel and change the configuration settings if necessary.

Complete the site migration. Check if the resource works correctly on the new domain. Delete copies of the site files (if they were copied, not transferred) from the directory corresponding to the old domain. Set up pagination from the old domain to the new one. Disable basic authorization to access the old and new site.