(ab)using the hotsync feature

For all guru’s around (especially @federico.ballarini) on hotsync module.
I was triggered by this recent topic in our forums:
https://community.nethserver.org/t/hotsync-dc-no-user-present/187874

I also see topics like using hotsync as backup strategy (what I don’t think is the best way to backup) but it could be a way to fastly move a server from one location to another. without dealing with the hardware too much.

My situation: I have a several VPS’s running NS7. These VPS’s all have proxmox as hypervisor and I have access to both SSH as VNC with root privileges.

What if I create a similar VM on my personal ProxMox environment, and do a hotsync, would I end up with a complete ‘copy’ of the original server and have the original server still in place, working as it is supposed to be?

It would be a nice extra, expecially when going from 1 spec server to another… (create the specs of the old VPS, do a hotsync, adapt the hotsync to the new specs and hotsync back to the new VPS with new specs)

1 Like

The problem of two different server is only (for what I know) on NICs.
If they are called differently, you have to set them before start with the hotsync. See there: https://docs.nethserver.org/en/v7/hotsync.html#restore-put-slave-in-production

If you want to do some tests, we can then improve the package togheter.
Thank you!

3 Likes

I will fire up my proxmox environment and see how it will go… Will let you know later…

2 Likes

Hi Robb,

I don’t think that this is completely true. Not every module ist supported by hotsync.
If you want hotsync to sync custom paths, you have to tell it in /etc/hotsync.d/ with a file like I did for my urbackups called urbackup.sh and make it executable:

#!/bin/bash

#
#  This file includes urbackup into hotsync
#
#  R. Jeckel 15.04.2021


# source configuration file
[ -f /etc/hotsync.conf ] && source /etc/hotsync.conf

INCLUDE_FILE=$1
EXCLUDE_FILE=$2

# ceck if urbackup is installed
if rpm -q --quiet nethserver-urbackup; then
    # include urbackup directories
    echo /var/lib/urbackup >> $INCLUDE_FILE
fi

See also: nethserver-hotsync — NethServer 7 documentation.

BR

1 Like