Make a WordPress backup manually – .com

In today’s tutorial I will tell you how to manually backup WordPress (without plugins). What should you copy and how should you do it?

There are many (a lot of) plugins that serve to make backup copies of WordPress. And if you want I will cover them in future tutorials one by one in detail. But sometimes we want to do things manually. So, as a complement to the tutorial, today we see how to make a copy of WordPress manually.

This method is especially interesting in the case that you are going to make important changes in your WordPress. For example, a massive plugin update, or a very “crucial” plugin such as WooCommerce, especially if you haven’t updated it for a long time.

Actually, to do this kind of thing you should use a staging service, which consists of being able to “clone” your WordPress instantly on a test server, where you can do the experiments, and if everything works correctly, transfer it to production. But on many occasions we do not have this service. So, let’s see how to make a copy manually, which will allow us to return to it immediately if all else fails.

To begin with, let’s remember that any backup must take into account two key things to copy: records and the database.

WordPress File Backup

This is the easiest and simplest of all. There is no complication. We just need an FTP program like FileZilla or Coda and that’s it. We connect to our server and locate the folder where the files of our website are.

It can have several names, but is usually “web”, “html”, “httpdocs”, “public_html” or “public_httpdocs”.

If in our FTP we do not have any folder with those names, you simply have to look at what is inside one by one until you find one with these files:

Once you have located it, you have a couple of options. The first is to simply download it to your computer, to have a “local” copy. In this way, if after making the changes to the web “something goes wrong”, you simply have to upload the one you have locally again so that everything returns to normal.

But another much faster and more effective method is to duplicate it on the server itself. This will depend on the FTP program you are using, but normally you just have to click the right mouse button and hit “Duplicate”.

See also  WP-CLI Course #1. Introduction - .com

That will create an identical folder, with the same content, with a different name. Sometimes it adds a “copy” to the end of the name, or sometimes a “2”, or sometimes a “Duplicate of …” in front of it. Does not matter. The fact is that we already have a backup on our own server.

Let’s notice that interesting and convenient is to do it like this, since in the case that we want to quickly restore our backup, we only have to change the name of the folders. The process is the following:

  • I have “web” and “web copy” (web and backup respectively).
  • I make the modifications and updates (affecting only “web”).
    • Does everything go well?
      • Perfect, now we can delete the security copy “web copy”.
    • Does something go wrong?
      • No problem: We change the names of the folders:
        • “web” we change it to “web damaged”
        • “web copy” we change it to “web”

In other words, with a simple folder name change, we can “return” to the good version of the web. Much faster than downloading and uploading all the files every time.

Well, so far “easy.” Now we go for the hard nut to crack. The database.

WordPress Database Backup

The second element that we must make a backup copy of is neither more nor less the most important thing on the web: The database, that is, the content. The texts of our articles, pages, products… all the information that we are introducing little by little to our website. That is not stored in files, but in a database.

So, if they are not files, how are we going to be able to make a copy? Well, exporting (or copying) the database. And how we do it? Well let’s go there!

The first thing you should do is access the database through the database manager phpMyAdmin. To access there are several ways, and they depend on each hosting company. In other words, you will have to access your control panel and there look for the access, normally you will find it in the “databases”, “BBDD” or “MySQL” section.

See also  Facebook Course #4. Creator Studio - .com

Once we have accessed we will see the intimidating interface of our database through phpMyAdmin:

I have to admit that the first time it is a bit scary to move around here, since it is very easy to touch something that you shouldn’t and make a mess, but when you get used to using this tool, you realize that it is your best ally. That is what we have been able to verify on several occasions in the , in which we have solved several brown spots only by changing a piece of information through phpMyAdmin.

Well, among other things, this tool allows us to download our database in a .zip file that we can save on our computer, in the same way that we have done it with the FTP files.

To achieve that, we simply go to the “Export” tab that we can see in the top menu and click on the “Continue” button:

This will generate a “sql” file that will be downloaded automatically, which, if necessary, we can import again in the “Import” tab:

But once again, that’s a bit slow and sometimes you have certain size limits, like for example in the case of the image, which only allows us to upload files of 30MB.

In those cases, we can do the same “trick” that I told you about before with the FTP files. In the same way that we duplicated the “web” folder before, we are now going to duplicate the database. How? Easy, here we go:

The first thing we must do is go to the “Databases” tab and select our database (usually there will only be one) and then we go to the “Operations” section of the top menu:

In this panel we can do many things, among them create tables, change the name of the tables, or even… yes sir, duplicate them. For that we go to the “Copy the database to:” option and indicate the name of the database that we are going to use as a backup, in this case “copy”.

By doing this, the system will generate an identical copy to our database, in the same way that we created a copy in the folder called “web copy” before, but this time we will have the copy in a database called “copy”.

See also  JavaScript course for HTML5 - .com

And now that we have a backup, we can make the changes to our website. In the event that something goes wrong, we just have to change the name of the database, with the same methodology as before:

  • I have “originaldatabase” and “backup”
  • I make the modifications and updates (affecting only “originaldatabase”).
    • Does everything go well?
      • Perfect, now we can delete the security copy “backup“.
    • Does something go wrong?
      • No problem: We change the names of the folders:
        • “original database” we change it to “broken database”
        • “copy backup” we change it to “original database”

And ready! With that simple change of names, we can now switch between the two databases. A much faster process than having to export and import the entire database every time.

And if you don’t want to be changing the names of the database, another even faster option is to modify the file wp-config.php, in the line where there is the name of the database. In this case, where it says:

We must modify it to say:

In this way, with a simple name change we can switch from the “original” web to the “backup” web. It’s like a kind of very archaic “staging site”, but it works perfectly.

conclusion

Before making any important changes to our WordPress, we must make backup copies. There are many plugins that do this, but in some cases we want to do it manually.

For that we will make a backup copy of the files and the database, which we can save on our computer in case we need to “go back”.

An interesting technique is to create the copy on the server itself (duplicating files and database) to be able to restore both with a simple name change.

And as always, if you want to know more, you can take a look at the . See you in the next tutorial! 🙂

Loading Facebook Comments ...
Loading Disqus Comments ...