I want to ask what are the options and ways you guys use to backup and restore complete server, complete os, everything from hard drive? Let's say i have a dedicated server at hosting x and i want to backup everything on weekly or daily basis in case of hardware failure or if something goes wrong when updating. I am thinking of using either rsync or bacula and i want to backup everything to another server or to my pc. There is no option to make a snapshot or backup entire ssd/partition at hosting level so i have to do it my self. So far i've been using rsync to do backups of user files like /var/www/clients folders and it's simple and easy to backup and restore files that most often do not change, but doing complete server backup with rsync ? Is it doable, is it easy or complicated, i guess i definitely need to avoid backing up swap, tmp, proc folders? I didn't use bacula yet but i find it as a possible solution. What do you recommend or use ?
I don't. My systems run as virtual machines, which I can back up as snapshots. But even if one of those systems crashes and it is unrecoverable, I have a backup of the configuration files and the data. All I have to do is set up a new server and restore it.
I use BackupPC, available from Debian and Ubuntu repositories. My servers are virtual machines in Proxmox host, and Proxmox takes nightly dumps of the virtual disks.
The number of snapshots allowed on my account is only one and that expires in 30 days... from the date of its creation... what could be other option so that snapshot lasts as long as we need
That's a limitation of your hosting company and not a limitation of snapshots in general or ISPConfig. Ask your hosting company why they do not provide permanent snapshots or use a different hosting company to run your virtual server.
When you have limitations like this on hosting company you have to look at alternative options like I do or other hosting companies. So far best I found for my backups is to use rsync, i wrote small bash script which make backups on daily and weekly cron and also on manual request. Arch wiki have very good article https://wiki.archlinux.org/index.php/rsync#Installation I started from there and extended it per my needs.
Regarding ISPConfig configuration files and data (except db), what need to be back-upped, in order to restore ISPConfig?
You were asking about ISPConfig configuration itself, and all ISPConfig related settings are in the database. But yes, the Apache vhosts can be rebuild from the database. Zone files as well. But data from the /var folder should be backed up by the admin and is ofcourse not saved in the ISPConfig DB. And if you customized settings for Apache, Postfix, etc, this is not saved in the DB either of course.
I do not recommend the following way. It is much better to often create snapshot and backups. You could import the ISPConfig DB, then log in to the panel and do a resync of the sites or zones under Tools -> Resync.
Agree, but there is a delta between the snapshot and the regular file backup. We always shut down the server for snapshots, hence they are not very frequent. Anyway, we do file backup on /root, /etc and most under /var, and all databases. Assume that is enough to make a decent restore. Like restore the snapshot, restore db's, restore /root, /etc and what we have in /var from file backups.
You might add /usr/local/ispconfig in your backup list. Note as you don't have a question pertaining to the "howto" tutorials, I'm moving this thread to a forum for ISPConfig issues.
To fully restore an ISPConfig system, you need: /var/www /var/vmail /etc /var/log/ispconfig (optional, if you want to keep log history) And all ISPConfig databases.
also, depending on the tutorial you used to originally install the server, and possibly multiple versions of php, along with other possible software like ispprotect, bandaemon etc. you may also want to backup /opt as well.
Well, I always use your auto-install script now, its excellent. I guess /root also is good, since acme amongst other reside there.