How to migrate WordPress without dying in the attempt

By: Jorge Albiol
Published: 30 Sea 2020
Commentaries: 0
Categories: Maintenance Web
Jorge Albiol
Full Stack Developer in the Art Of the Web. Enthusiastic of all that with the world Web.

Nonencounter better way to wear for the first time our blog, that to write an article explaining the different forms in which WordPress can be migrated. Recently we have remodeled our Web, with all the derived tasks that it entails, and among them is the migration. Surely, if you have arrived up to here is because you are on the verge of facing to you this process, so I invite to you to that you do not lose detail, since this post will be to you helpful.

By where we began?

First of everything, it takes to two or three times air and arms to you of patience, because to migrate WordPress it is a task that has been a time. Obvious, the process will vary based on light or the heavy thing that is our page.

Secondly, it identifies which of the following situations describes better your case:

  • You have created the Web in a local servant, and now you want to migrate WordPress to a production servant.
  • You have the Web in operative, but you are going to change WordPress of domain.
  • You have the Web in production, but you want to migrate WordPress to another supplier of hosting.

Whatever your case, you do not worry. We are going to see how to migrate WordPress in each one of the assumptions without dying in the attempt, and we will do it using plugins or manually.

The first step as always, independent of the assumption in which you are, is to make a backup copy of the archives and the data base. You can do it through Control Panel of your supplier of hosting or use software of third parties. We usually use FileZilla and PhpMyAdmin, although in some occasion also we have used MySQL Workbench. Here already, to the taste of each.
Once we have backups created, it is the moment for home.

Migration with change of domain

This assumption is applicable, whether you have created the webpage in a local servant, as if it is giving service but you wish to change it of domain (for example, of https://tunombrededominio.com to https://tunombrededominio.es). For this last case, I will explain to you more ahead as making a redirection 301 so that you do not lose all the SEO that you have cattle.

Beam login in back office where is at the moment the Web, and next vetoes to General Adjustments >. Once there, it changes URLs present by the new ones. For example, of http://localhost to https://tunombrededominio.com, or as in the example of more above.

To change URLs in WordPress

After keeping the changes, it is probable that we receive an error 404. You do not worry because he is something normal. It again continues doing backup complete of the archives and data base.

Modification of files

The following step that we are going to realise, is the edition of the file of import of the data base (nombredefichero.sql). You can use a text editor as Notepad++, Sublime Text, Atom, etc. The objective is to replace the present URL by the one of destiny. Following the previous example, we are going to make the pertinent modification with Notepad++.

After opening the file with the program, we pressed Control+H to open to the window search/replacement. We introduce the data as one is in the image of down and punctured in Replacing everything.

To replace URLs

Finally, we pressed the combination of Control+S keys to save the changes in the file.

Now without leaving the text editor, we are going to come to modify the data of our file wp-config.php, which we copied during last backup of archives. After opening it, we will have to modify the data that are in inverted commas simple, of the lines that are in the image of down.

File wp-config.php WordPress

Before modifying the file, assure to you to have created the data base previously.

If you do not have the information to form the section of the connection to the data base, you can normally find them in the panel of administration of your supplier of hosting, or can directly ask them them.

Once you have modified the data, saves pressing them Control+S.

Turned over of data in the new servant

After realising the changes in the files, it is time to raise them the servant and the data base. As we mentioned previously, these tasks we realised them with FileZilla and PhpMyAdmin. In first we dragged the archives from the local folder towards the remote site (servant). In the second we selected the data base, we punctured in the eyelash €œTo matter€, and raised the file with extension SQL.

If everything has left as had, when acceding to the new URL, that in our case is https://tunombrededominio.es, we will see the main page of the Web.

Arrived at this point, we can say that we have been able to migrate WordPress 😊.

To create a redirection 301

This step only applies if you have a webpage in production and you change it of domain. That is to say, it is not applicable if you have created your page in localhost and you put it in production.

The objective of this step is that you do not lose all the SEO that you had cattle with the old domain, and that redirijas towards the new one. In that it is what a redirection 301 consists. For it, .htaccess copies the following code in your file:
RewriteEngine On
RewriteCond % \ {HTTP_HOST} ^tunombrededominio \ .com$ [OR]
RewriteCond % \ {HTTP_HOST} ^www \ .tunombrededominio \ .com$
RewriteRule ^ (. *) $ €œhttps \: \/\ /WWW \ .TUNOMBREDEDOMINIO \ .COM \ $1€ [R=301, L]

It is not necessary to say, that each must put its names of corresponding domains, and have the precaution of redirigir to HTTP or https, according to comes.

Migration without changing the domain

Now it is the turn to migrate WordPress without changing the domain. This situation often usually occurs when it changes of supplier of hosting, and unlike the previous section, we will not have to modify URLs.

The first step, is to as much make a backup copy of the files as of the data base. Once you have it realised, it creates a data base in the new servant and points the connection data at the same. Later wp-config.php with the information of the new servant modifies the file and raises the archives. The last step is to concern the file with extension .sql to the new data base.

If everything has gone correctly, we would have to visualize the webpage as it was in the old servant.

I know that in the previous section I was a little more precise as far as the level of details, so if you have arrived at this point directly, I recommend to you that you read it to know the tools and passages with which to matter/to export the files.

To migrate WordPress WITH DUPLICATOR

Many exist plugins that helps us in the arduous task of migrating WordPress, as for example, All-in-One WP Migration or Duplicator. Particularly, I like much more Duplicator, since she has an own installer and she is to me much more intuitive. For that reason, I am going to explain how to do it with this last one.

First that you must do, it is to unload plugin to you, or from own WordPress or this connection. I give by seated that you know how plugin settles, so I am not going away to stop in explaining it to you.

Once we have installed Duplicator in the origin servant, it sees the section of packages of its contextual menu. There it punctures in €œCreating new€.

Duplicator - To create package

He will appear to us an assistant of three steps who will create our package of installation:

  1. In this step assign a name to the package, and in case you have the information of connection to the data base in the new servant, introduce it. If you still do not have her, you will be able to later facilitate it during the installation process.
  2. In this step an assistant begins who verifies the viability of the migration. In case it exists some warning will show it as in the image.

Duplicator - Verifications

In such case, we marked that we want to continue with the ceraci³n process and punctured in €œCreating€.

  1. This it is the last step, and it is where the archives of the installation are generated. Once they are generated will appear a window as this, where we will have to puncture in €œUnloading a click€.

Duplicator - To unload package

Once we have unloaded the archives in our equipment, we will come to raise them the root of the new servant, always having taken care of not modifying its names. Finished the ascent process, we will enter the following URL: https://tunombrededominio.es/installer.php. He will appear an assistant of four steps very intuitive, in which we will have to pay attention to point 2 (connection to the data base). If we already did it at the time of creation of the package it will not be necessary to do nothing. On the contrary, we will have to specify the data and to prove the connection.

When the assistant finalizes, the same flock by security the installation archives. If he could not do it by itself, he will show a warning so that you erase the archives manually. Once they are eliminated, the migration will have finished.

Conclusion

To migrate WordPress is a task that can be complicated, more than nothing by the disadvantages that sometimes arise in the way.

The method manual, in multiple occasions does not finish working, reason why the appearance and functionality of WordPress are affected when finalizing the process. In many occasions we have been ourselves forced to alter Webs in the servers of clients, or to even have to migrate them again. This, is without a doubt a great €œhandicap€ at the time of choosing the migration manual, and for that reason always I recommend the use of plugins destined for such aim. The amount of work and hours that save these programs to you, is without a doubt strength to show preference for them.

I take leave leaving you some connections that surely will be of your interest.

Until soon!

Corporative Web

corporative Web

Landing page

landing page

Store online

it lies down online

0 commentaries

To send a commentary

Your email address will not be published. The obligatory fields are noticeable with *