Students lesson 43 assignment: How do you backup WordPress databases?
One simple task every webmaster should learn is backing up MySQL databases. When you’re managing a website or IT system, you should always have a backup plan.
A plan that will get you restored if something goes wrong with the systems you’re managing.
When it comes to WordPress and MySQL databases, that same strategy should apply.
This brief tutorial is going to show you how to easily backup your WordPress MySQL databases using cPanel as well as from Linux command terminal.
Step 1: Backing up MySQL databases via cPanel
Since many of 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 gear towards new users as well as students. It makes managing websites easy, so easy 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:
Lesson 8: Manage MySQL Database Server with phpMyAdmin on Ubuntu
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 save the export. Choose a location on your local computer and save the database file.
That’s how you backup MySQL databases via cPanel.
Step 2: Backing up MySQL databases via command line
Another way one can backup MySQL databases is via the Linux terminal. This is a more advanced way to backup MySQL.
With MySQL installed and access to your terminal server, run the commands below to logon 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:
That will show all the databases configured on the system. Record the database name 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 in to the directory you’re working from.
Save a copy to a safe location and you’re done. There might be other ways to backup MySQL databases, but these are the two easiest ways to do it.
Thanks for reading and please come back soon.
You may also like this post:
Lesson 27: Use MySQL Wizard in cPanel to Create Databases