How to Export and Upload Database in PhpMyAdmin cPanel
By Aslam | December 6, 2022
The best way to have your website data safe and secure is that have a database backup where all the data will store in the website files. The cPanel and WHM are complete MySQL management solutions and are installed on the same server. To manage a large amount of data efficiently, MySQL stores all the data of the WordPress website in form of tables that are created in a single database which allows you to create and manage it.
This tutorial will help you to know the Export database in PhpMyAdmin and How to upload database in cPanel. Before uploading the database, kindly take the backup before it in .SQL format (only supports it).
Export database in PhpMyAdmin:
- Login to the cPanel account of the respective website.
- Click “PhpMyAdmin” under the “Database” section to enter the database tables.
- After entering, click the “database name”, ex “agenslothoki_wp240” which has synchronized with the WordPress config file.
If you have two databases, check the wp-config file inside the file manager – public_html folder and see the database name configured.
- Then click the “Export” tab on the top menu.
- You can choose “quick” to export the SQL database fully.
NOTE: Don’t change the format.
Or “Custom” to choose select specific tables within the database, or change Format-specific options.
- Now click “Go” at bottom of the page. The MySQL file is now downloaded successfully.
Using Backup (export):
- Login to cPanel
- Click the “Backup” option under the “Files” section.
- Now click “agenslothoki_wp240” to download directly without any further steps as followed above.
Points to note before exporting the database:
- The database you import should not have any injected codes hacked in the tables.
- All the previous tables must be removed by clicking the check all check box and choosing the “drop” option and clicking “Go” to make it empty.
- Make sure to take a complete import backup of the database even if you have two databases.
- Make sure to not exceed the disk space to log in to PhpMyAdmin. If exceeded, it will show an error.
ALSO READ: How To Restore File And Directory In cPanel?
Import database in PhpMyAdmin:
- On the same page of the database, click the “database name”, ex “agenslothoki_wp240” which has synchronized with the WordPress config file.
If you have two databases, check the wp-config file inside the file manager – public_html folder and see the database name configured. Also, import the database on that correct database.
- Then click the “Import” tab on the top menu.
- Now, click the “choose file” button and upload the file exported.
NOTE: Don’t change the format.
- Now click “Go” at bottom of the page. The MySQL file is now uploaded successfully.
How to upload database in cPanel Using Backup (import):
- Once you have downloaded the backup, remove the database table completely leaving the database empty using the step suggested before.
- Now click “upload” under restore the backup on the same page as shown below.
Points to note before importing the database:
- Check whether you have imported the SQL file or not.
- Before uploading check the following names such as database prefix, database name, and database username, of the uploading file in notepad if you are uploading another website MySQL database or an old database with a different name.
- Also, check the website name is the same as the uploading database website name under wp_options.
Hope this article helps you successfully export and import the database.