It’s quite easy to back up the WordPress database and then restore it. Even you can backup your WordPress database on your own even if you don’t have any technical knowledge.
On the other hand, backing up your entire WordPress site and database time to time is important to keep your site secure. So in this article, I am going to share with you the two most obvious ways by which you can backup the WordPress database of your site.
So let’s dive in..!
- How To Backup & Restore WordPress Site Free Using UpdraftPlus Plugin?
- How To Backup WordPress Site To Computer?
What is WordPress Database?
In simple words, a Database is a place where you can store your data. We can say a database is a collection of data in an organized way that can be accessed and manipulated easily. Data may be anything such as text, media, and fIles, etc. There are many databases and their types are available such as-
- No SQL
You can perform CRUD operations on database. CRUD Stands For-
CRUD is the most basic operation which is performed on database to achieve desired results. You can manage and store data very efficiently with databases.
In order to store and manage data of your WordPress site, WordPress creates MySQL database automatically during the WordPress installation time.
How to Backup WordPress Database?
There are several ways to back up the database of your WordPress site. Either you can backup the database using C-panel, or you can backup the WordPress database using PHPmyadmin. Or you can use mysqldump backup program to back up the database of your WordPress site. Or you can use a WordPress plugin, there are several ways to perform the same task.
Right now in this article we are going to backup the WordPress database using-
- The PhpMyAdmin
- The C-Panel
How to Backup WordPress Database Using PhpMyAdmin?
Time needed: 5 minutes.
How to Backup WordPress Database Using PhpMyAdmin?
- Login inside your hosing’s C-Panel
Login to the C-Panel of your web hosting first to take the backup of all the tables of your WordPress site’s database.
- Head over the Database, then PHP MyAdmin
After logging in inside the C-Panel, head over the Database and then PHP myAdmin.
After logging in inside the PHP MyAdmin, you can see the databases of all the sites if you are running multiple sites.
- 3, Find the Database of the site
Find the database of the site which you want to backup from PHP MyAdmin. If you are hosting only one WordPress site then, probably you may have only one database of your site.
- Select the Database by clicking on it.
As you will select it you will start seeing all the tables of that database which you have to download.
- Click over the Export section
Now click on Export to export all the tables of your database inside your local computer.
- Final Step
Now to export the tables select the format SQL, and click on Go button. This will start exporting your database inside your computer.
How to Backup WordPress Database Using C-Panel?
First thing first, C-Panel is one of the easiest ways to back up the database of your WordPress site. If you are on shared hosting with C-Panel, you don’t need to backup your WordPress database using any other method. Because you can do all the backup and restoration work using C-Panel.
To backup your WordPress database using C-Panel first login inside the C-Panel of your web hosting.
Now, from the C-Panel move towards the Backup Wizard.
From the backup wizard, you can backup and restore the database of your WordPress site. You can backup the files of your WordPress site also using the backup wizard.
Now, Click On Backup.
Now from the partial backup select MySqlDatabase.
After that select the database which you want to backup and download.
How To Restore WordPress Database?
As you have backed up your database then you probably will need to restore it. So you can restore the WordPress database with ease as you backed it up.
But still, you need to pay attention while restoring the WordPress database so that you can restore it properly. As WordPress creates a database while installation. And it stores all the information of the database inside the wp-config file.
So, while restoration you might need to make some changes inside the “wp-config” file
How To Restore Database Using PHPMyAdmin?
To restore database with PHPMyAdmin first login to C-Panel then head over database to create a database. After creating the database create the user for the database and set this user for the database while giving all the privilege access.
Now head over to the PHPMyAdmin. Now, here you can see the database which you have created. Select the database and click on import.
Choose the file of tables which you have backed up using PHPMyAdmin.
After choosing the file scroll down you mouse cursor and click on “Go” button.
It will take some time depending upon the size of the tables of the WordPress database of your site. After Some time you will get a success message.
Now you have created a new database, but the WordPress which is installed on your site don’t know about it. In order to point this database to your WordPress site, you will need to make some changes inside the wp-config file.
Head over the root directory of your WordPress site and find the “wp-config.php” file inside the root directory of your site.
Now, I would recommend you to download this (wp-config.php) file to make changes inside it, so download it inside your local computer.
Open the file with the help of any text editor such as NotePad++. If you don’t have NotePad++ you can download it here.
Changing Settings of wp-config.php File
Now after opening the “wp-config.php” file, find the MySQL settings inside the file where the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST are defined.
If you had never made changes inside the wp-config.php file before, you can get these functions from line 24 to line 32.
Now inside the define( ‘DB_NAME’, ‘Database User Name Here’ ); function, enter the name of your database as a second parameter inside the “define()” function.
For example, my database name is DBWORDPRESS. So I will pass the second parameter DBWORDPRESS inside the function.
define( 'DB_NAME', 'DBWORDPRESS' );
Now enter the db username inside the second define() as a second parameter inside your wp-config.php file.
define( 'DB_USER', 'Database username Here' );
After that enter the database password inside the third define() as a second parameter inside your wp-config.php file.
define( 'DB_PASSWORD', 'Database Password Here' );
In the final step, Enter the database hostname inside the fourth define() as a second parameter. If you don’t know the name of your database host, you can take help from your web hosting provider’s support team.
By default the host name is localhost in most of the cases.
define( 'DB_HOST', 'localhost' );
Now save this file and upload it inside the root directory of your WordPress site and make sure to remove the older file from the root directory.
I hope you understood this technical thing, if you are still confused please ask me in the comment section. I’ll definitely help you to solve your confusion.