Website backup from apache with database

hamid.sattar

New Member
Joined
Apr 14, 2021
Messages
10
Reaction score
0
Credits
98
Hi
I want to back up websites from apache. Its debian 11 with apache server. There is almost 5 websites in var/www.

I am not sure if there is database along with websites.

Can someone guide me how can I take backup without any data loss
 


My first question would be:

Is there any web hosting control panel, like cPanel, Plesk, WebMin, etc?
 
No. There is no cpanel.
We are hosting those websites in debain 11 on apache.
 
Alright, you can backup the data in var/www in the usual fashion and you can use mysqldump to backup your database. Both of which can be turned into cron jobs, so that you make continued, scheduled backups.

Something like:

Backup and compress /var/www/ content:
Code:
tar -zcvf backup.tar.gz /var/www

Do a dump of the database to a backup .sql that can be restored easily:
Code:
mysqldump -u <username> –p <password> <database_name> > <dump_file.sql>
 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).
I am getting this error. When trying to login into database.
 
You might need the actual user/password - not root. Unless your databases have root as the user? If that's the case, I'm not sure what's going on (or how to fix it) and I'm even less sure why someone would do that. You normally want your database user to be at least a little obscure.
 
Is it safe to assume the positive vote/like on the last reply was the solution to your databases, at least?
 

Members online


Top