This is code I found in my stash this was created by nixtree Id had paid for to move vps nodes what this does it moves all the vps’s that are on the vzlist.
you would add the vps id on the vzlist that you want to move. This comes in handy.
for VSERVERID in `cat vzlist.txt`;
vzmigrate -v --ssh="-p 22" $DESIP $VSERVERID
if test $? -eq 0; then
echo "$VSERVERID completed" >> /tmp/completedlist.txt
echo "$VSERVERID failed" >> /tmp/completedlist.txt
Now if you want something more custom I’d recommend nixtree they are very good at what they do.