How to set up smartphones and PCs. Informational portal
  • home
  • news
  • How to move from wp to another platform. Database transfer

How to move from wp to another platform. Database transfer

One day, there may come a day when you need to change your address. This can happen due to the fact that the domain chosen long ago does not fit the content of the site anymore, or you simply want to acquire a more attractive brand for yourself. In any case, if you need a site for another domain, then you will certainly need a detailed guide.

In general, it is not so difficult to transfer WordPress to another domain on your own, but in the process, some problems may arise that will be difficult to solve without the appropriate skills. Therefore, it is recommended to use special plugins that automate part of this process. If you still decide to do it manually, then carefully read this manual.

Please note that this guide assumes a clean domain and transfer of content from the existing one.

This is the easiest method and the least problematic for novice users.

Step 1: Disable Permalinks

The first thing to do before moving WordPress directly to another domain is to disable permalinks. To do this, select "Settings> Permalinks" in admin panel, check the "Simple" option and save your changes.

Step 2: Backing up the database

The next action is backup databases of the production site to hedge against unforeseen situations. Before you start copying, check if your hosting does it automatically.

To copy the database manually, you need to use the PhpMyAdmin web application that your hosting provides access to. Just select the desired database on the PhpMyAdmin page and go to the "Export" tab. Then, click "OK" and save it to your computer.

Step 3: transfer files

Now using your own FTP client or the file manager that your hosting provides, download the entire contents of the wp-content folder from the production site to your computer. Be sure to check that absolutely all files are downloaded, without any loss, this is very important.

Step 4: Installing a New Site and Uploading Content

Everything is simple here, install WordPress on a different domain to which the site will be transferred using your preferred method. This can be done the way your hosting offers or manually. Then, replace the contents of the wp-content folder of the new site with the contents of the corresponding folder downloaded to your computer. Be sure to make sure the new site has correct structure catalogs

Please note if you have used automatic installation the wordpress that the hosting offers, then you will have a new base data. Since we will be using backup old, then this one must be removed. Do the following:

  • Go to PhpMyAdmin through hosting;
  • Open the database of the new site;
  • Click on the "Structure" tab;
  • Check the box below “Check all”;
  • Nearby, in the drop-down list, select "Delete" and confirm the action.

Step 5: Editing the Database

Exactly this important action in the process of moving, since it depends on it whether the site will work at the new address at all. You will need to change all direct links in the backup database to contain the new address. Since some URLs in WordPress are serialized, you should never replace them with a text editor.

Fortunately, there is special script Search-Replace-DB, with which you can make the replacement of links in WordPress automatically, taking into account serialization. Just upload the script folder to the hosting, next to wp-content, and go to "your-site.ru/Search-Replace-DB-master/index.php".

On the page that opens, paste in the field " search for... "the old domain (for example, http://your-site.ru), and in the" replace with ... "field a new one (http://new-your-site.ru). Then, in the "actions" block, click the "live run" button and wait for the end of the link replacement process. Once the replacement process is complete, export the edited database, just as you did before.

Step 6: Load the database

After the old database is edited, it can be uploaded to another site. To do this, go to hosting and open a new database in PhpMyAdmin. After that, go to the "Import" tab, select the edited backup file and click "OK".

Step 7: Login to admin panel and enable permalinks

All details for entering the admin panel should be the same as before. Even if you specified a different username or password when you installed a new WordPress site, they will still be overridden by the imported database.

Once you are in the admin panel, go to Settings> Permalinks and return old look Urls.

Step 8: create a 301 redirect

Another important nuance, which should not be skipped when carrying out the transfer, since it depends on users getting to the new site when they click on the old links. And this applies not only to the main page, but to all available pages and posts that some users may have in their bookmarks.

To redirect visitors to the new address, you will need to access the old domain via FTP. In the root directory, you should find a file called "ht.access" (if it is missing, just create a new one and put it there). Then, open this file in any text editor and add following lines:


RewriteEngine On
RewriteBase /
RewriteRule ^ index.php $ - [L]
RewriteCond% (REQUEST_FILENAME)! -F
RewriteCond% (REQUEST_FILENAME)! -D
RewriteRule. /index.php [L]

If this code was already present in the file, then add only this line to it:

Redirect 301 / http://new-your-site.ru/

Save the file and make sure the redirection works and you are taken to the new site at the old address.

Step 9: Submit XML Sitemap to Google

The migration is almost complete, you just have to warn the search engines about it. The best way do it without spoiling SEO optimization, create and submit an XML sitemap to Google. It's very easy to do, you just need to install google plugin Sitemap XML, go to its settings and send the finished maps to Google.

Conclusion

Migrate WordPress to a completely different domain not so difficult task if you do everything in the order described in this article. But, as you know, everything does not always go according to plan, therefore, it is very important to make a backup copy before starting the entire procedure in order to restore the site in case of serious errors. By the way, this move method can also be used to move to new hosting.

Today I will talk about transferring a WordPress site from hosting to hosting or from hosting to Denver, as well as to new domain or to another folder.
The content of the article:

Why is there a problem migrating a WordPress site

Sooner or later, each of us has to face a move, for this there are a number of reasons. The most common of them is dissatisfaction with hosting, when you no longer have the strength to endure, you start thinking about changing the hosting provider. Although in this case it is easier to leave a request for technical support to transfer your site (any decent hosting provides such a service for free). I had to change hosting a hundred times, until one day I finally got no luck, now I use hosting and I advise you.

The causal domain change may be the site being filtered or banned. search engines, then you will have to choose another domain and start promotion from the beginning.

But you never know what reasons made you start moving your site to WordPress. Personally, I needed to deploy local version site in Denver (read), because working with a local site is faster and more convenient. On it, you can experiment with blog settings and plugins without worrying about the site's performance. Therefore, I advise everyone to have a local version, let it be.

Moving WordPress to another hosting

1. Download site files and database from the old hosting

Method number 1:

Go to old hosting to make backups current state files and databases. Usually, when ready, backups are saved in the root directory of the hosting in an archived form.

To get to this folder, you can use FTP (I use Total Commander or File Zilla) or via file manager hosting (this method is more convenient, as it seems to me). Download the resulting archives to your computer. Unpack the database.

If for some reason you were unable to make backups, there is second way:

Next, go to the database management section of your hosting, select phpMyAdmin. In the left column, select the name of your database from the list. Go to the Export tab and click OK. Save the generated file.

So, the database dump as a file with the .sql extension and the archive with all the blog files are on our computer and are ready to be transferred to another hosting.

2. Transferring data from a computer to a new hosting

In the "databases" section of the new hosting add a new database user and a new database, create a password for it and remember it. It looks like this for me:

Attention! If you change the same Domain name, now you need to complete the item "", then go back and continue in order.

Open phpMyAdmin, find your database in the list on the left, go to the Import tab. Upload the previously downloaded database dump with sql permission and click OK (Go).

Now upload the archive with files to ftp and unzip it. Make sure that in the end the files are in the correct folder, on my hosting this is the public_html folder, it can also be called httpdocs, www or otherwise, depending on the hosting. Make sure this folder is empty before unpacking the archive into it.

3.Configuring connection to the base and setting rights

Find the wp-config.php file at the site root. Change the database connection data in it to new ones:

/ ** Database name for WordPress * / define ("DB_NAME", "your_database_name"); / ** MySQL username * / define ("DB_USER", "database_username"); / ** MySQL database password * / define ("DB_PASSWORD", "database_password");

Set the permissions (attributes) to 777 for the wp-content / uploads folder and all subfolders. This is done via ftp or in the file manager:

Linking your domain to a new hosting

Your site should start working on the new hosting, but you cannot check it yet, because the domain still refers to the old hosting. To fix this situation:

  • Ask the new hoster for it DNS servers... Usually they are written in a letter sent to your mail when registering a hosting.
  • Go to Personal Area your domain registrar - the site where you bought the domain. I use 2domains.ru and will tell you how it is done there. Find the "Manage DNS Servers" section and change the DNS servers to new ones:

Now you need to wait until the changes take effect and the domain is linked to the hosting. It can take up to three days, but experience shows that in a couple of hours you will already be able to load your site.

If you are not moving to a new domain, the lesson is over for you. If the site doesn't work, take a look.

Moving WordPress to another domain, folder

If, in addition to hosting, you need to transfer your site to another domain, you will have to face some difficulties. Unlike most CMS, in WordPress all paths are registered with absolute links (this is an unpleasant minus of the system) and we have to deal with them manually. Let's go in order:

1. Working with the database

When you downloaded the database dump from the old hosting, you need to open it in an editor (I use Dreamweaver) and replace all references to the old domain with the new ones:

There is another way: when you import the database, go to the SQL tab and make three queries:

UPDATE wp_options SET option_value = REPLACE (option_value, "https://old_domain.ru", "https://new_domain.ru") WHERE option_name = "home" OR option_name = "siteurl";

UPDATE wp_posts SET guid = REPLACE (guid, "https://old_domain.ru", "https://new_domain.ru");

UPDATE wp_posts SET post_content = REPLACE (post_content, "https://old_domain.ru", "https://new_domain.ru");

2. Changes to.htacces and robots.txt

Find such files in the root directory of the site, find references to your old domain name in them and replace them with a new one.

3. Changes in site files

Note that this item is optional. If everything works for you, then you can skip it. Sometimes it happens that the topic also creeps in absolute links to the old domain and they need to be replaced.

You can unpack the archive with your site files and search through all these files for the presence of the old domain in them. Similar to working with the base, change the old links to the new ones. Hooray, we are done with the transfer of wordpress to another domain.

Moving a site to another folder

If you need to move your blog to a different folder (e.g. domain.ru/blog), make the following changes to .htaccess (changes in bold):

# BEGIN WordPress
RewriteEngine On
RewriteBase / blog/
RewriteRule ^ index \ .php $ - [L]
RewriteCond% (REQUEST_FILENAME)! -F
RewriteCond% (REQUEST_FILENAME)! -D
RewriteRule. / blog/index.php [L]
# END WordPress

Possible errors related to moving your WordPress blog

In case your site doesn't work, here are some examples. typical mistakes... If your mistake is not in the list, leave a comment, I will gladly expand this list :)

  1. Error establishing a database connection. This error happens if the data is entered incorrectly in the wp-config.php file.
  2. The WordPress installation page has opened. A similar situation could have occurred due to a database import error. Try deleting all database tables and re-importing the dump.
  3. You see your hosting provider's welcome page. This may be because you did not empty the public_html (httpdocs) folder before unpacking the archive into it. Delete the index.html file.
  4. Forbidden. You don "t have permission to access / on this server. You may have uploaded the site files to the wrong folder.

The algorithm is as follows:

  1. Choose the right base data.
  2. Click on the "Export" menu item in top menu.
  3. Determine the export method. Considering that all the default settings are saved, you can use the "Quick" option. I only choose "Normal" if I want to compress the file.
  4. Make sure all WordPress database tables are selected for migration.
  5. If the "Normal" option is specified, then you can define the compression when exporting.
  6. At the very bottom of the page, click "Ok".

As a result, the application will create a database dump and offer to save it on the computer. All settings, as you can see, are set initially, and in 99% of cases nothing needs to be changed.

The import process is even easier. Let's say you already have an empty site database created in cPanel, where you want to transfer all the information from the past. Procedure:

  1. Go to PhpMyAdmin and select a new database.
  2. In the top menu, click on the "Import" item.
  3. After clicking on the "Choose File" button, select the SQL file to import on your computer.
  4. Click "Ok" at the bottom of the page.

After successful completion of the procedure, you will see a corresponding message, and a list of created tables will be displayed on the right under the name of the new database. This is the migration wordpress bases completed. Then you return to the rest of the stages, if you did it.

Database migration plugins in WordPress

In the article about, I mentioned a couple of modules that help change the domain name (and other information) in the site base. Making edits manually in PhpMyAdmin would be extremely troublesome and not always safe. I will not review the plugins in detail, but will only present their main advantages.

Important! All three plugins are able to work with serialized data and do the correct replacement of information in the database (taking into account the length of the line), for example:

s: 11: "hello world" becomes s: 9: "new world"

s: 11: "hello world" becomes s: 9: "new world"

There may be errors when executing SQL and editing directly through PhpMyAdmin.

Initially, it only allowed making edits to the database, but in latest versions the developers have significantly expanded its functions. Now you can also download a dump and restore the database, change the domain, prefix. New interface made it generally great. In the article I will tell you a little more about the module, although everything is extremely simple here. Downloads - 100k +, rating - 4.4.

This tool can be used not only when migrating a WordPress database, but the entire site. allows you to transfer media files, plugins, themes. You can also start the procedure for searching and editing data in the database. Distinctive feature is an fast work(so as not to burden the hosting provider), as well as the absence of the need to install additional PHP extensions. The solution even works with PHP v5.2, while the previous one requires at least PHP v5.4. More than 300 thousand downloads, rating - 4.8.

Performs the main tasks of transferring a database to WordPress: exporting a dump, finding and replacing information, saving SQL files on the computer. More than 200 thousand. downloads, score - 4.7. Free version, in principle, enough, although of course in PRO I expect more cool chips... You will have to import the database through PhpMyAdmin, as I described in the first section.

Using the Search and Replace plugin

I have come across this module most often, so I will analyze it in more detail as an example. I think the process of transferring the WordPress database in other versions is the same, as a last resort, see the video instructions in their descriptions on wordpress.org.

So. after Search and Replace and activation, all its functions are located in the same-named menu item of the "Tools" section. There are 4 main directions:

  • Backup Database - creating a backup.
  • Search & Replace - search and replace information.
  • Replace Domain URL - change domain.
  • SQL Import - import.

In the first and last paragraphs, there is only one button "Export / Import", but, in fact, you have everything you need to fully migrate your WordPress database and site. The only thing to remember is that the data is imported into the current database connected to the project.

Go to the Replace Domain URL section. In fact, it provides the ability to replace the old domain with a new one.

This feature will not save you from the rest of the steps in the algorithm, but, at the very least, it will simplify the task of transferring the database to WordPress. In addition, you can change the table prefix, which is also useful.

The Search & Replace tab helps replace information in the database.

  • First of all, you define the old and new values, then mark the tables where the search and replacement should be performed.
  • By default, the "Dry Run" option is enabled, which means that the actions will be performed in the "test mode".
  • If you uncheck the box, then 2 options will appear to choose from - import SQL query and for making edits to the database or directly performing this action.

That is, in fact, you can do: 1) a test run of the task, 2) a real data replacement, 3) get an SQL query, and then inject it through PhpMyAdmin or the 4th tab of the module. Great flexibility!

Total. I hope you have enough information on transferring a database to WordPress in order to independently carry out this procedure. In principle, there is nothing complicated, but when working with a database, you always need to be extremely careful - at least create backups before starting work. All three plugins do their job well, but I personally like Search and Replace the most - simple, flexible, without unnecessary details.

If you have anything to add about transferring and migrating a wordpress base or sites, write in the comments.

Today, every person who has his own site on the Internet may face the problem that he will need to transfer the site to another hosting. There can be many different reasons for this. Of course, the most common of these is dissatisfaction with the services provided. If you can't stand it anymore, then you need to act. This is a rather lengthy procedure. If you do everything step by step, you can safely transfer the site, and not redo everything several times. So, how do you migrate a WordPress site while saving the settings? In this article you will find all the answers to your questions.

Correct site transfer to Wordpress

If you used a fairly popular hosting, then perhaps you can use the site transfer service. Moreover, it is usually carried out completely free of charge. Of course, if this is not possible, then you will have to do everything yourself. First, you need to consider the algorithm of actions in order to correctly transfer a blog or site:

1. First, you need to copy all files from your site.

2. We also export the database from the old hosting.

3. After transferring all files, you can connect to the new hosting.

4. Create a database and import the data you saved into it.

5. Go to config file, in which you need to change the settings for connecting to the new database.

6. At this step, you can check the correctness of all actions. You can use a technical domain or a temporary URL for this.

7. On the last stage you need to change the DNS of the domain. To do this, go to the control panel of the domain name registrar.

This is a rather long list. If all these steps are followed correctly, you can migrate WordPress from hosting to another hosting. This can take a long time, but don't rush. You need to make sure that all actions were performed without errors.

Moving files from the old hosting

This is a fairly straightforward action. If you yourself were engaged in the creation of the site, you can quickly figure it out and do everything right. To carry out the transfer WordPress blog to another hosting, you need to connect via FTP to the old server. After that, we download all the data to our computer. You also need to pre-prepare the folder where you will save the files from the old hosting.

Comment. If you need to move several sites at once, and you want to cheat, then it would be logical to move the entire folder with the name public_html at once. After that, also upload it to the new hosting. Unfortunately, on many hosts due to different structure folders may fail this kind of trick. Each site or blog will have to be moved separately.

Database transfer

You need to export the old database to phpMyAdmin. You can go to this directory through the control panel. You will need to find a link to phpMyAdmin under Databases. This step is required if you have cPanel installed.

In a new window, select the desired database, and then go to the "Export" section. Next, you need to change a few parameters. We go down to the item "Export method" and select "Normal". Scrolling a little lower, you will see the "Output" section, and in the "Compression" item, set the value to gzip.

It remains only to confirm your actions by clicking on the "OK" button. The download of your database will start immediately after that.

Moving a WordPress site from one domain to another

In the third step, you need to add which you are going to transfer. This can be done in the hosting control panel. You need to understand that on many hosting services you cannot upload files until you link a domain to the site. That is, the www folder will not be created without an associated domain name.

So how do you bind it? As we already found out, you need to go to the control panel. Next, you need to find the "Domains" section and go to it. Next, click on the "Add domain name" button. It remains only to indicate former domain and confirm your actions.

Uploading files to new hosting

In the previous steps, we prepared everything for uploading the site files. This is a fairly simple step that you can quickly get through. First you need to connect to the new server via FTP. Once connected, you will notice one directory called www. By navigating to this folder, you can see another folder with the name of your domain name. It is also necessary to drop all the files that were on the previous hosting into it.

It is worth noting that if at the first stage you copied the entire folder, then you need to paste not the folder itself, but all the files that were in it. That is, if you copied a directory, for example, my_blog, then it should not be contained in a folder with the same name. You will need to open it and move all the files that were on the old server. It would seem like a rather stupid mistake, but it is often made, so it was worth mentioning it.

You also need to make sure that there are no failed transmissions. If you nevertheless allowed this, then you need to download such files again. If you do not do this, then in the future you will have errors in the work of the site.

Database creation

At this stage, we need to create a database on the selected server. How to do it? There is nothing complicated about it. Go to the control panel and select the "Databases" item. Next, click on the "Create Database" button. In a new tab, enter the password and name for the new database.

It is worth noting that a prefix with the login that you specify when entering the control panel will be automatically added to the name of the database.

Importing data into the database

Now it is necessary to transfer the information that we saved on the computer at the very beginning of our journey to the new database.

Go to phpMyAdmin on the selected hosting. Next, go to the "Databases" section. Now you need to look at information about your database. To do this, you need to click on the "Login Information" button.

On the new page will open useful parameters that you need to save to connect the database to our site. But first you need to login to phpMyAdmin. By clicking on the corresponding button, you need to enter the password from the database.

PhpMyAdmin will open on a new page. Now you need to perform the opposite steps to what we did when exporting information. This shouldn't give you any trouble, but it's worth considering the data import algorithm:

To transfer to another hosting WordPress site, you need to go to the selected database.

On the top panel you need to click on the "Import" button.

Go to the "Imported file" field, where you need to specify the path to old base data. It must be archived.

Of course, loading will take longer if the database is quite heavy. At the end, you should receive a successful download message. If this does not happen, then you need to reload the database.

Configuring the connection of the site to the database

At this stage, we need to set up a database connection to a WordPress site or blog. These settings are stored in a file called wp-config.php.

This file can be found at the root of the site itself. Next, you need to find this document and open it. Let's move on to the lines where the parameters are displayed in the define function: DB_NAME is the name of the database, DB_USER is the name of the database user, DB_PASSWORD is the password, DB_HOST is the database server.

To transfer a blog to another hosting WordPress, you need to fill in this data from the window that we opened earlier - "Login Information". In the second parameter of the define function, you must specify the required information.

We check the quality of the site or blog transfer

Almost everything has already been done. There are only a few steps left. At the penultimate stage, you need to check the quality of your work. But how to do it? Since the domain name does not yet point to our site, you need to use a technical domain or a temporary URL (this is the same, the name depends on which hosting you are trying to check your site or blog on).

To transfer a blog to another hosting WordPress, you need to find out the technical domain name. To do this, go to the "Domains" section. Next, select desired name and click on the "Tools" button. In a new window, you will be able to see a link to the temporary URL for your blog. We click on it and check the correctness of the work of our site.

When you go, you will be able to open home page... If this does not happen or other pages do not open for you, then there were some problems during the transfer. Possible problems and their solutions are discussed below.

Registering DNS

If you checked the site, and it works well, then you can proceed to the final stage. You need to change the DNS of the domain name. Now, in order for the site to be visible to other users, you need to specify the path to the site on the new hosting.

To transfer your blog to another hosting WordPress, you need to change the DNS in the control panel of the site where the domain name registration services were purchased. This happens in different ways on different services. If you already had a working site, then you know how to do this. Also, on each such site there is technical support, which responds quite quickly.

DNS changes quite quickly. In a few hours, people will be able to visit your resource again.

Possible errors and solutions

1. If you get a message that it is not possible to connect to the database, then you need to check the change in the file called wp-config.php. The problem is that the data entered into this file is incorrect.

2. If your site does not open, but only begins installing WordPress, you need to load the database again and check that the download was successful. You also need to check that loading in progress exactly to the database that connects to the server.

3. If instead of opening the site, only White screen, you need to check the files that you uploaded to the hosting. Download the data from the old server again and reload it to the new one.

4. If, instead of normal text, various distortions and incomprehensible symbols, you need to change the encoding in all tables to utf8_general_ci.

5. If the problem is that there are many strange words, you should look at how plugins work. This is most likely the cause of the error. Examine the message given by the server and navigate to the appropriate plugin. To transfer a WordPress site to another hosting, the plugin needs to be removed, this should fix the problem.

Site transfer services

If you have problems when transferring a site and you yourself are not able to fix them, then you can use the help of professionals. There are many various services who provide these services. An easy transfer of WordPress to another hosting will cost you anywhere from 1,000 to 2,000 rubles. They promise to move the site to another hosting within one day.

It's pretty inexpensive. You can pay and not worry about the safety of your information. These studios assure that they are backing up the site, researching its structure and transferring the site's link mass so that it does not lose its rating.

You can move your site to another server for free if such services are provided by hosting. You need to find out about this right away so as not to spend the whole day on transferring your project. You can find out more about this in the technical support of the site. Of course, these services can be paid from the hosting. It can be cheaper than special companies who are engaged in site transfers.

Conclusion

Transferring WordPress from one hosting to another is a rather laborious procedure that requires certain skills. You can use an algorithm to help you move your blog step by step. You need to prepare for this and free up your time. If you have not dealt with site transfer before, then it may take a lot. How do I transfer my WordPress site to another hosting? Even if it doesn't work out, don't be upset. You can order site transfer services and the next day receive your site, which will be on the new hosting. Remember that hosting can provide you free services on site transfer. If you find out that this is possible, then clarify everything in more detail in technical support.

Sometimes a situation may arise when you need a site running on the engine WordPress, transfer to a new domain. Those. the essence of this action is only in domain name change, all the content, as well as the link structure, remains the same. At the same time, not an unimportant moment - preservation of TCI and PR indicators.

TO this issue must be approached with full understanding cases, because the opposite can be fraught with unpleasant consequences.

The transfer process can be roughly divided into 2 parts:

  1. Moving a site running on WordPress engine, to the new domain.
  2. Create a 301 redirect from the old domain to the new one.

Moving a WordPress site to a new domain

First of all, you need to do 2 things:

  • copy all ftp files from the old domain to the new one;
  • necessarily create a backup of the site database so that you can rollback in case of anything.

Further actions can be performed in one of the following three ways.

The first way

This is the easiest way, requiring a minimum of action from you.

  1. Go to the admin panel of your site to the page "Settings - General".
  2. In the fields « WordPress URL» and "Website address" specify the URL of the new domain and confirm the changes by clicking the button "Save changes".
  3. Ready. At the same time, WordPress will redirect you to the login page of the admin interface, but already on a new domain.

Second way

  1. Open the saved sql database dump in a text or PHP editor.
  2. Replace all occurrences of the old site address with the new address, For example, http://domain.ru replaced by http://newdomain.ru, and save your changes.
  3. Upload the dump to the database on the server after removing all existing tables from it.
  4. Ready. The WordPress site is running at a new address.

The third way

  1. Go to phpMyAdmin and select your database.
  2. Click on the " SQL"And execute the following 3 queries one by one, replacing http://domain.ru and http://newdomain.ru respectively on the old and new addresses site (note that at the end of the address there should be no slash):

      UPDATE wp_posts SET guid = replace (guid, "http://domain.ru", "http://newdomain.ru");

      UPDATE wp_posts SET post_content = replace (post_content, "http://domain.ru", "http://newdomain.ru");

  3. Ready. The site will now open at a new address.

Creating a 301 redirect from the old domain to the new one

It remains to ensure that when accessing any page of the site using the old address, the visitor is automatically redirected to the same page in the new domain.

This requires replace content of .htaccess file located at the root old domain, to the following (a new domain is indicated instead of newdomain.ru):

Options + FollowSymLinks RewriteEngine on RewriteRule (. *) Http://newdomain.ru/$1

This completes the procedure for transferring your WordPress site to a new domain.

Now a few words about preservation of TCI and PR indicators of the site.

The above directive, in addition to its direct purpose, allows you to transfer the indicator to a new domain Google PR, so there shouldn't be any problems with PR.

However, the question of transferring the indicator remains open for me. TCI Yandex... I have read enough information on this, but I still have not found a definite solution. Basically, it is recommended to create a file on the old domain robots.txt specifying the Host: newdomain.ru parameter, it won't work because of the 301st redirect.

I would be grateful to someone who will clarify this issue for me.

Added on 04.24.

I myself found the answer to my question. So that when accessing the old domain, a 301 redirect is triggered, but with the exception of the file robots.txt, in file .htaccess the old domain, you need to specify the following:

RewriteEngine off Options + FollowSymLinks RewriteEngine on RewriteRule (. *) Http://newdomain.ru/$1

And in the robots.txt file, specify the following:

User-Agent: * Disallow: Host: newdomain.ru

Top related articles