GFI Software

Welcome to the GFI Software community forum! For support please open a ticket from https://support.gfi.com.

Home » GFI User Forums » Kerio Connect » rsync + Kerio Connect Backup Strategy Reality Check (To avoid performance hits, I'd like to have a second KC install JUST to run backups)
rsync + Kerio Connect Backup Strategy Reality Check [message #146612] Mon, 16 September 2019 22:36 Go to next message
jcooper is currently offline  jcooper
Messages: 113
Registered: May 2009
Location: Syracuse, NY
Need some advice:

Is it bad to have a second "backup" kc server, with all services off, but with the same domain, authenticated to AD? I'd like to try to set up a backup strategy where I rsync my mail store nightly, then use the backup kc server to run the actual backup job?

No dns settings anywhere point to the backup server; users don't even know it exists. I'm just trying to save performance issues when I run a backup, since they can take a while but rsync is pretty quick.

Thanks,

Jeff
Re: rsync + Kerio Connect Backup Strategy Reality Check [message #146633 is a reply to message #146612] Wed, 18 September 2019 23:49 Go to previous messageGo to next message
Bud Durland is currently offline  Bud Durland
Messages: 586
Registered: December 2013
Location: Plattsburgh, NY
You're using rsync, I presume the two servers are Linux.

- Install KC on the backup server (with it's own IP, obviously), configure mail store location, etc. Tweak the start up to not automatically start the KC service.
- Set up rsync, let it run. Don't forget to copy the user.cfg and server.cfg files once is a while

If you need to switch to the backup server, change it's IP address (and maybe hot name) to match the failed mail server, and start the KC service.
Re: rsync + Kerio Connect Backup Strategy Reality Check [message #146644 is a reply to message #146633] Fri, 20 September 2019 11:51 Go to previous messageGo to next message
giampos is currently offline  giampos
Messages: 82
Registered: May 2005
Ok, but....wich folders need to be synchronized? Only store folder and it's subfolders or also program folder?
And when there's an upgrade release...what to do?
Re: rsync + Kerio Connect Backup Strategy Reality Check [message #146647 is a reply to message #146644] Fri, 20 September 2019 18:24 Go to previous messageGo to next message
j.a.duke is currently offline  j.a.duke
Messages: 239
Registered: October 2006
I posted this for migrating, but I use the same tools/techniques for DR/Failover in-office:

https://forums.gfi.com/index.php?t=msg&th=37721&goto =146500&#msg_146500

Quote:
Here's my method for doing this migration.

Install same version of Kerio on both systems (so update your new server to 9.2.10 to match the old).

I have my Kerio store folder on the external RAID (probably like you do as well). And Kerio is installed at /usr/local/kerio/mailserver. Kerio is running on the old server. Kerio is installed but not running on the new server.

Setup a new Carbon Copy Cloner backup task on the current server to backup the external HDD RAID to a Remote Macintosh destination (i.e. the new server) and select the SSD RAID there.

Setup another backup task to copy specific files from /usr/local/kerio/mailserver to that same path on the new server. The files/folders you want to copy are:
dbSSL (folder)
license (folder)
mailserver.cfg
mailserver.cfg.bak
settings (folder)
sslcert (folder)
users.cfg
users.cfg.bak
If you have any custom SpamAssassin rules, you'll want to add the appropriate files from /usr/local/kerio/mailserver/plugins/spamserver/spamassassin/ rules.

You can run these backups while Kerio is running on the old server.

When the cutover time comes, stop Kerio on the old server, run the backups one last time (manually if needed), shutdown the old server, apply static IP from old server to new server (either public or private), then start up Kerio on new server.

I've used this method to migrate 3 or 4 times on one server with great success. And I'm currently using this on my personal Kerio server to keep old and new in synch until I'm ready to cutover.

If you have any questions, please let me know. I'd be more than happy to answer them.

PS: This procedure (using different platform specific backup tools) should work for Windows & Unix as well.
Note that the paths to the store and application directories may be different from what I've listed above (on both Linux & Windows).

Also, I've found that when your mailstore is rather large, you might be better served breaking the rsync tasks down a little bit. I'm not at the account folder level yet, but in groups of 4 or 5 due to the total number of items in each account (many people have in excess of 200k emails in their accounts after a dozen years on Kerio). This time issue is an issue primarily for DR usage, trying to keep the mirrored mailstore as up-to-date as possible. I'm within 10 or so minutes of real-time currently. While not perfect, it's far better than a nightly backup.

As always, I'm happy to answer any and all questions to the best of my knowledge/abilities.

Cheers,
Jon
Re: rsync + Kerio Connect Backup Strategy Reality Check [message #146648 is a reply to message #146647] Fri, 20 September 2019 18:44 Go to previous messageGo to next message
Bud Durland is currently offline  Bud Durland
Messages: 586
Registered: December 2013
Location: Plattsburgh, NY
When we moved Kerio from one data store to another, we ran into the issue the total number of files being too much for rsync in one gulp. I found this script somewhere on line and modified it a bit; basically, it recurses the mail folder and processes each user folder as it's own rsync operation. Modify as appropriate for your purpose. You will want to add copying of the mail server's settings files, SSL folder, etc. as well.

#!/bin/bash
SOURCE=/kerio/mail/example.com
DESTINATION=/vol1/kerio/mail/example.com
RSYNC_ARGS="-avr --delete-after --log-file=/vol1/temp/user-inc-2.txt" 
STARTTIME=`date "+%D %T"`

if [ ! -d "$SOURCE" ]
then
    echo "Error: $SOURCE isn't a directory."
    exit -1
elif [ ! -d "$DESTINATION" ]
then
    echo "Error: $DESTINATION isn't a directory."
    exit -2
fi

find "$SOURCE" -maxdepth 1 -mindepth 1 -type d -exec rsync $RSYNC_ARGS "{}" $DESTINATION \;

echo Started $STARTTIME
echo Ended $(date +"%D %T")

exit 0

[Updated on: Fri, 20 September 2019 18:45]

Report message to a moderator

Re: rsync + Kerio Connect Backup Strategy Reality Check [message #146652 is a reply to message #146648] Sat, 21 September 2019 16:35 Go to previous message
simion.chis is currently offline  simion.chis
Messages: 20
Registered: February 2014

Saved in snippets folder Smile

Thank you!
Previous Topic: Difference Between Relay Control and Sender Policy SMTP Settings
Next Topic: Differential Backups Seem to Miss Emails
Goto Forum:
  


Current Time: Thu Jun 01 03:34:56 CEST 2023

Total time taken to generate the page: 0.08755 seconds