MKhost Knowledge Base

MKhost
Knowledgebase

Need help? Search or browse our large collection of articles on a variety of topics including hosting, domains, emails and more.

0cPanel

How to Backup and Restore Databases via php MyAdmin and cPanel

 

Database Backup via phpMyAdmin

 

You first need to log in to the cPanel account in the Databases section - phpMyAdmin


The newly opened window on the left has a list of all databases, and on the right you can edit the database itself, add tables, make backups, restore restaurants and other settings that may be useful.


You will select the database on which you want to make a Backup (on the left side of the window) click on Export and select the format in which you want to backup. (If the database is smaller then it is usually selected in .sql format, you can select from the slider menu and choose zipped backup, this option is selected for larger database), then click Go.


Database file restoration


From the right side of the window, you need to select a database in which you want to import or restore a specific database. If you want the restored base to be in a completely new database, you first need to create it (creating an empty database)

This is done through the cPanel account in the Database - MySQL section, properly setting up the database name and creating it. Than you create a new user with the appropriate username and generate a password for it, adding the same user to the corresponding previously created database. All this data is very important to note and save it as it will be needed in the connection section of the database.

 

After you do that, you can select the newly created database from phpMyAdmin on the right to restore it to the database you want to set up. Then you click on Import and select the database you want to restore and click on Go. Once this is complete and all the content is restored, you need to find the configuration file that allows connecting to the database. To connect to the database, you need to change DB_NAME, USER_NAME, and PASSWORD to these places in the configuration file and you need to upload the previous data you saved. When setting up you must set the full database name and user (along with the domain name before, in the following format username_imenadatabaza).


Database Backup via cPanel

 

Sign in to your cPanel account and in the Files section, click Backup

 

 backup

 

In the Download a MySQL Database Backup section, first click on the name of the database you want to backup.

 

Download a MySQL Database Backup


Open the folder where your web browser has downloaded the bacup and you will need to see a .sql.gz file there.


Database Restoration via cPanel

 

Log in to your cPanel account in the Files section Backup

 

In the Restore a MySQL Database section, first click on Choose File. Find the file you want to restore and then click Open.

 

Restore a MySQL Database Backup


Once you've done this, it should have the name of the database you want to restart, and then click Upload.