Backup database on server and restore?

Gojko

Well-Known Member
Nov 24, 2014
112
7
68
Macedonia
cPanel Access Level
Root Administrator
Hello, i installed CL and i want to set options, but i want to backup completely database so i can upgrade/update.
I can't find to backup whole server database and restoration documentation.

So thinks what i wont:
1.backup database (system,user...)
2.update database
3. if fail, restore database (system,user...)

how i can do this?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
Hello @Gojko

If you'd like to backup all the databases for all your users on the system you'd need to do a full server automated backup. This can be setup but going to WHM>>Backup>>Backup Configuration. This will not just backup databases but the full accounts which will also include the database backups.
 

Gojko

Well-Known Member
Nov 24, 2014
112
7
68
Macedonia
cPanel Access Level
Root Administrator
Right so there is no way to backup only databases.
I have another question, i know how to restore accounts and databases for users, how i can restore system database?
When i go to WHM > phpmyadmin i see all databases for users, but if something is broken and because of database i can't login to WHM how i can restore database for system trough terminal?
Of course database which is prevision created trough backup options in WHM.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
Right so there is no way to backup only databases.
Well there is, just not through WHM. You can back up databases on a per account basis in cPanel or by using mysqldump's --all-databases flag such as discussed here: Export and Import all MySQL databases at one time

I have another question, i know how to restore accounts and databases for users, how i can restore system database?
When i go to WHM > phpmyadmin i see all databases for users, but if something is broken and because of database i can't login to WHM how i can restore database for system trough terminal?
There is no "system database" most of our internal databases use sqlite and shouldn't ever need to be restored, in what circumstance have you experienced something like this or do you have an example of behavior you're trying to rectify?
 
Last edited:

Gojko

Well-Known Member
Nov 24, 2014
112
7
68
Macedonia
cPanel Access Level
Root Administrator
Thank you for a link it didn't show on my google search when i google it.

No, i want to be prepared for anything because i want to upgrade mysql to MariaDB after that install CL Mysql Governor. And if something goes wrong so i can restore. Or any other disaster recovery scenario.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
The best thing to have in that instance is account backups for all accounts on the server, the rest is just a matter of reinstalling cPanel in the event of an emergency. Also we're happy to help with cPanel specific issues if you ever need assistance identifying a problem or resolving something cPanel specific we'd be happy to work with you on it, feel free to open a ticket in those circumstances.
 

Yiannis Ath

Registered
Jun 4, 2019
1
0
1
Athens
cPanel Access Level
Website Owner
I want to upgrade the DB to the last version. For that, i need to back up the whole DB and be able to restore it.
This is what Cpanel suggests to do BUT is not giving us the tools to make it.
any suggestions?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
I want to upgrade the DB to the last version. For that, i need to back up the whole DB and be able to restore it.
This is what Cpanel suggests to do BUT is not giving us the tools to make it.
any suggestions?
I'm not sure I understand what you mean, we do indeed provide a method for you to backup all accounts, we also provide per account a method to backup that accounts databases. If you want to backup all databases you would need to use mysqldump to do this which was explained in the first response.