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
 


OP
H

hamid.sattar

New Member
Joined
Apr 14, 2021
Messages
10
Reaction score
0
Credits
98
No. There is no cpanel.
We are hosting those websites in debain 11 on apache.
 

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
6,678
Reaction score
5,846
Credits
53,744
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>
 
OP
H

hamid.sattar

New Member
Joined
Apr 14, 2021
Messages
10
Reaction score
0
Credits
98
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).
I am getting this error. When trying to login into database.
 

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
6,678
Reaction score
5,846
Credits
53,744
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.
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
4,894
Reaction score
3,524
Credits
35,628
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Top