Kopano backup
-
Dear all,
I would like to secure my installation with regular backups and 2 of 3 different kinds of backups are running. My Kopana (univation) server is running in a virtual environment and on a monthly bases the complete server will be backuped offline. Second, from Monday to Saturday a sqldump is running and the output is stored on another network device. I’m now looking for a best practice of running a database offline backup of my database on Sunday. The process should run fully automated by the cron daemon. Which processes needs to be stopped in which way and are there additional directories which needs to be backuped in addition by storing some attachements from the kopano system?
Thanks in advance
Uwe -
Personally I do something rather drastic. On a Sunday I stop kopano-server, then take a physical copy of the database MySQL files /var/lib/MySQL every sunday.
This Is in addition to the sql dump that I take daily.
And just to be more paranoid, since the MySQL database is running on a separate virtual machine, on Sunday I copy the entire virtual machine too and I keep a copy of that too.
-
Looks good and I try to do a similar approach but a kopano-server stop is not working. May be it is related to the univention installation.
root@kopano:~# ps -ef |grep kopano
kopano 422 1 0 11:05 ? 00:00:00 /usr/sbin/kopano-ical -F
kopano 451 1 0 11:05 ? 00:00:00 /usr/sbin/kopano-gateway -F
kopano 452 1 0 11:05 ? 00:00:00 /usr/sbin/kopano-dagent -l
kopano 453 1 0 11:05 ? 00:00:01 /usr/bin/python2 /usr/sbin/kopano-search -F
kopano 455 1 0 11:05 ? 00:00:00 /usr/sbin/kopano-spooler -F
kopano 458 1 0 11:05 ? 00:00:00 /usr/sbin/kopano-monitor -F
kopano 514 455 0 11:05 ? 00:00:00 /usr/sbin/kopano-spooler -F
kopano 515 452 0 11:05 ? 00:00:00 /usr/sbin/kopano-dagent -l
kopano 1454 1 0 11:05 ? 00:00:00 /usr/sbin/kopano-server -F
kopano 1612 453 0 11:05 ? 00:00:00 /usr/bin/python2 /usr/sbin/kopano-search -F
kopano 1629 453 0 11:05 ? 00:00:00 /usr/bin/python2 /usr/sbin/kopano-search -F
root 5449 5431 0 11:08 pts/0 00:00:00 grep kopano
root@kopano:~# kopano-server stop
Fri Nov 23 11:08:47 2018: [=======] Starting kopano-server version 8.6.2 (pid 6483)
Fri Nov 23 11:08:47 2018: [crit ] Unable to bind to port 236: Die Adresse wird bereits verwendet. This is usually caused by another process (most likely another server) already using this port. This program will terminate now.
Beendet
root@kopano:~# ps -ef |grep kopano
kopano 422 1 0 11:05 ? 00:00:00 /usr/sbin/kopano-ical -F
kopano 451 1 0 11:05 ? 00:00:00 /usr/sbin/kopano-gateway -F
kopano 452 1 0 11:05 ? 00:00:00 /usr/sbin/kopano-dagent -l
kopano 453 1 0 11:05 ? 00:00:01 /usr/bin/python2 /usr/sbin/kopano-search -F
kopano 455 1 0 11:05 ? 00:00:00 /usr/sbin/kopano-spooler -F
kopano 458 1 0 11:05 ? 00:00:00 /usr/sbin/kopano-monitor -F
kopano 514 455 0 11:05 ? 00:00:00 /usr/sbin/kopano-spooler -F
kopano 515 452 0 11:05 ? 00:00:00 /usr/sbin/kopano-dagent -l
kopano 1454 1 0 11:05 ? 00:00:00 /usr/sbin/kopano-server -F
kopano 1612 453 0 11:05 ? 00:00:00 /usr/bin/python2 /usr/sbin/kopano-search -F
kopano 1629 453 0 11:05 ? 00:00:00 /usr/bin/python2 /usr/sbin/kopano-search -F
root 6820 5431 0 11:08 pts/0 00:00:00 grep kopano -
not sure how it works on univention but normally I type things like
service kopano-server stop
i.e. it’s a service not a program.
-
Here is what i do in my regularly daily cron-job:
#!/bin/sh
day=$(date +"%a")
echo “Daily Backup started”
/usr/bin/mysqldump --single-transaction --routines -u kopanoDbUser kopano | gzip -9 > /mnt/backups/Kopano/sqldump/${day}-kopano.sql.gz
cp -r /var/lib/kopano/attachments /mnt/backups/Kopano/
/usr/sbin/kopano-backup --worker-processes 1 --log-level warning --output-dir /mnt/backups/Kopano/kopano-backups/
cp -r /var/univention-backup /mnt/backups/Kopano/
echo “Daily Backup finished” -
@dondu1960 said in Kopano backup:
root@kopano:~# kopano-server stop
as @mcostan already said you would need to execute this either as
service kopano-server stop
or directly through systemd assystemctl stop kopano-server
. What you did here was starting another instance of kopano-server just with the argument “stop”.Stopping the kopano-server process is totally unnecessary if everything you want to do is make a dump of your database. What you would need to do here is simply pass the option
--single-transaction
to mysql.(a downside of stopping
kopano-server
is that you lose all your cached information btw and caches have to be refilled after the process is started again)This is all explained in the manual btw. https://documentation.kopano.io/kopanocore_administrator_manual/upgrading.html#creating-backups
-
Thanks. Working now as requested
-
In my case I stop kopano-server because I am paranoid hence I take a dump of the database (which indeed happens while kopano-server is running) plus a physical copy of /var/lib/MySQL (which requires the database to be stopped too) and then a physical copy of the disk of the virtual machine.
Paranoia that’s what it is called.