How to back up a WordPress database

|

|

This tutorial instructs newbies and students on backing up WordPress MySQL databases via cPanel and the Linux command terminal. On cPanel, one must use phpMyAdmin to manage and export the databases, and for the Linux terminal, specific commands are provided to access, list, and backup the required database.

This brief tutorial shows students and new users how to back up WordPress databases.

A straightforward task every web admin should learn is backing up MySQL databases. It would be best always to have a backup plan when managing a website or IT system.

A plan that will get you restored if something goes wrong with the systems you’re managing. That same strategy should apply when it comes to WordPress and MySQL databases.

Backing up WordPress databases is crucial for website admins or owners. This is because WordPress databases contain all the vital information about the website, including posts, pages, comments, site settings, and user accounts.

If something goes wrong with the website, such as a hack or a server crash, having a database backup backup can restore the site to its previous state. Therefore, it is essential to have a backup plan in place to prevent data loss and ensure the website’s smooth functioning.

Backing up MySQL databases via cPanel

Since many WordPress blogs and websites are being hosted with the help of cPanel, let’s start with that.

cPanel is a website hosting tool that’s primarily geared toward new users as well as students. It makes managing websites easy, so you don’t need to understand Linux or programming.

cPanel uses phpMyAdmin to manage MySQL databases. More on phpMyAdmin can be found at the link below:

To backup MySQL databases via cPanel, go to the Databases section in cPanel and select phpMyAdmin, as shown below.

Next, select the WordPress database from the left menu and click the Export button, as shown in the image below.

On the next page, choose the Quick export method and click Go, as shown in the image below.

Doing that will prompt you to select the location and save the export. Choose a location on your local computer and save the database file.

That’s how you back up MySQL databases via cPanel.

Backing up MySQL databases via the command line

Another way one can back up MySQL databases is via the Linux terminal. This is a more advanced way to back up MySQL.

With MySQL installed and access to your terminal server, run the commands below to log on to the database.

mysql -u root -p

When prompted, type the root password for the database to connect. To see the current list of databases, run the command statement below:

show databases;

That will show all the databases configured on the system. Next, record the name of the database you wish to backup and type exit.

On the terminal screen, run the commands below to backup the database

mysqldump -u root -p database_name > database_name.sql

Running that will download a copy of the database into the directory you’re working from.

Save a copy to a safe location, and you’re done.

There might be other ways to back up MySQL databases, but these are the two most straightforward ways.

Thanks for reading, and please come back soon.

Like this:



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.