Updates:

You can now choose from a number of pre-installed themes

Creating a server Image solution.

Started by Martin_Lancs, July 21, 2022, 03:29:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Martin_Lancs

Hi All..
I'm going to migrate a mail system to a bigger server and for the past few months I've been living by the skin of my teeth when it comes to backups. All data files are backup fine but if the server ever needed rebuilding it would take a few days. So I'm looking for an image solution that I can install on the new server before I start building/migration. Something that will sit in the background and a corn job would start the imaging the server and send it to a store. Or maybe have the new server as a client for the solution and the image is running from another small Linux box. Has anyone got any thoughts or been down the same road as I'm about to walk down? lol

thanks & regards
Martin... 

Mad Penguin

#1
Hi Martin,
Backups tend to be, dare I say "subjective" in terms of what people want or expect. For mail-server migration where files are typically held on the filesystem (courier for example) an rsync in advance, followed by taking the server down and a final rsync tend to work well with minimal downtime. Different story however if you have a db backed store like Zimbra, in which case a  (more complex) server-to-server backup might be in order.

If it helps, I use the following script for backups, this works well for random backups but can also works for migrations, you would just need to adjust "HERE" to be the target of your backups, and obviously a ssh connection between the servers.


#!/bin/bash
HOST="$1"
HERE="/vols/backup/servers/${HOST}"
BACK=`date "+%A_%d_%B_%Y_%H"`
EXCL=".excludes"
OPTS="--sparse --force --ignore-errors --delete-excluded

      --exclude-from=${HERE}/${EXCL}
      --bwlimit=4096 --delete --backup

      --backup-dir=${HERE}/${BACK}
      -rvlpgoDtO"
mkdir -p ${HERE}/current
touch ${HERE}/${EXCL}
nice -n19 rsync ${OPTS} [email protected]${HOST}:/ ${HERE}/current


Your "current" backup is left in ${HERE}/current, and for each backup you do, old / replaced files are left in time+datestamped folders, so you have a history of what's changed. Nice makes it run at a lower priority so it doesn't kill your machine, and bwlimit stops it from using too much broadband, probably remove this is you run locally. Any files you want to exclude from the backup, list them in "${HERE}/.excludes".

Use at your own risk - make sure you test it on non-critical files and understand what it does before trying it on live data.
https://twitter.com/garethbult
https://gareth.bult.co.uk


Martin_Lancs

thanks Mad Penguin for getting back to me.. The data files are fine I back them up and store them in two location one here in the UK and the other in Germany. I have moved away from using a VPS to DS and doing so has takes away the snapshots and with some providers the daily/weekly image backups. So need to have something to replace those options. thanks again for your thoughts!     

Mad Penguin

Ok, so imaging a DS in itself can be problematic, especially if you want to do a restore and don't have hands on. If you want actual images, what about virtualising your DS and running your mailserver in it's own VM. If you were to do this with KVM for example you would get easy access to the raw images for backup (and restore) and also snapshot facilities. (example screenshots attached) Unless your mail-server is unusually performance sensitive, typically you're not going to see any difference relative to running it native. You can automate both snapshots and image backups from the command line (or CRON) using "virsh" (and it does have specific support for 'hot' image backups)
I'm saying KVM, but if you have direct access to the machine, ProxMox (https://www.proxmox.com/en/) provides a pretty comprehensive bare-metal solution which adds all sorts of bells and whistles above and beyond standard KVM, not used it in a few years but I'd be fairly confident is will have a number of 'hot' backup options.
https://twitter.com/garethbult
https://gareth.bult.co.uk

Martin_Lancs

Now that's damn good idea!! The DS is a beefy one and if I run say VM workstation pro I could migrate other (but small) VM's across. Should save a few bob! I'll let you know how it pans out. Thanks Bud  ;)


Mad Penguin

Mmm, not entirely sure why you'd want to run virtualisation on Windows when the vast majority of the World runs it on Linux, but hey, it should also work. Not aware that VMware will do anything KVM or ProxMox don't, other than take money off you for Windows and VMware licenses (!)
https://twitter.com/garethbult
https://gareth.bult.co.uk

Martin_Lancs

It won't be running on MS (that's the last platform I would use) it will be VMware for Linux then playing around with it.

Mad Penguin

Mm, so now I'm intrigued. Most Linux distro's come with virtualisation "out of the box", Ubuntu for example comes with KVM/Libvirt/libvirtmanager which allows you to manage lots of VM's distributed over multiple servers. Proxmox for a more enterprisey solution .. what do you get from VMWare for Linux that doesn't come with the free options? Kinda feels like there must be something significant for people to pay and be subject to a relatively restrictive license, but it's not something I'm aware of?

I used VMWare server for Linux many (15?) years ago, just because I had some .vmdk machine images to load up, but I sort of thought since then it had died off .. mostly an assumption, but I couldn't really see the point of paying for something what was "built-in" and free?

https://www.serverwatch.com/servers/proxmox-vs-vmware/
https://www.redhat.com/en/topics/virtualization/kvm-vs-vmware-comparison
https://twitter.com/garethbult
https://gareth.bult.co.uk