Subject: Re: [vserver] Moving VServers from one host to another
From: Mike O'Connor <vserver@pineview.net>
Date: Sat, 09 Nov 2013 18:40:16 +1030

Hi All

This is a script we have been using for a long time to move vserver guests.

Hopefully this might help

Mike
> I've found it useful to use the --numeric-ids switch on rsync when you
> moving the guests data.
#!/bin/bash
VS=$1
DST=$2

# Syncing ${VS} guest directory to ${DST}
rsync --delete -aPSvx --numeric-ids /vservers/$VS/* root@$DST:/vservers/$VS

# Copying ${VS} config to ${DST}
rsync --delete -aPSvx --numeric-ids /etc/vservers/$VS/*
root@$DST:/etc/vservers/$VS

# Syncing ${VS} guest directory to ${DST}
rsync --delete -aPSvx --numeric-ids /vservers/$VS/* root@$DST:/vservers/$VS

# Syncing ${VS} guest directory to ${DST} again
vserver ${VS} stop
rsync --delete -aPSvx --numeric-ids /vservers/$VS/* root@$DST:/vservers/$VS

ssh root@$DST "echo default > /etc/vservers/$VS/apps/init/mark"
echo none > /etc/vservers/$VS/apps/init/mark

ssh root@$DST "vserver ${VS} start"