# Rsyncing /vz/private to other OVZ6 node, how?



## ICPH (Aug 1, 2017)

Hello,

i have tried to rsync one OpenVZ 6 VPS from node server to another using rsync:

rsync -Pavz /node1/vz/private/3710 /vz/private/3710
rsync -avz /node1/etc/vz/conf/3710 /etc/vz/conf/3710

but when tried to start destination VPS, i faced issues with TTy, /dev/null error. And others so i resigned to the rsync way.

Were You successful to rsync OpenVZ VPS by rsyncing private? What is needed to make it working?


----------



## Aldryic C'boas (Aug 2, 2017)

You should be using _vzctl <ctid> migrate_, not just manually copying files.


----------



## ICPH (Aug 4, 2017)

Aldryic C'boas said:


> You should be using _vzctl <ctid> migrate_, not just manually copying files.


Thx, this seems not to work when need to migrate from OpenVZ6 to OpenVZ7 (Virtuozzo). I tried https://openvz.org/Upgrade_script_from_OpenVZ_to_Virtuozzo_7 but it was extremely slow and not finished properly in numerous cases. So i was thinking about /private rsync way..


----------



## Aldryic C'boas (Aug 4, 2017)

What I'd suggest then is creating an OS template and deploying that. Trying to manually copy OVZ containers just typically ends in tragedy - best case scenario, you end up with a ton of extra work trying to find all of the little things you missed along the way just to get the thing to boot.


----------



## ICPH (Aug 4, 2017)

Aldryic C'boas said:


> creating an OS template and deploying that


I used HyperVM to create ostemplate, that one worked to be restored into new CT @ OpenVZ 6 by vzctl, but at OpenVZ 7 the result is:

# vzctl --verbose create 1000 --ostemplate centos-6-x86-CT1120 --config basic
running: /usr/sbin/vzpkg info -q --config ve-basic.conf-sample --ostemplate centos-6-x86-CT1120 --vefstype ext4
Error: Nothing to do
Error: Nothing to do
Error: Failed to install the template(s):
Error: centos-6-x86-CT1120-ez
Error: centos-6-x86-CT1120-x86_64-ez
Error: Failed to convert the precreated cache /vz/template/cache/centos-6-x86-CT1120.tar.gz
Error: Unable to find ostemplate: centos-6-x86-CT1120
# ls -l /vz/template/cache/centos-6-x86-CT1120.tar.gz
-rw-r--r-- 1 root root 764520763 Aug 4 15:18 /vz/template/cache/centos-6-x86-CT1120.tar.gz

OpenVZ 7 using prlctl to create template so i am unsure about template compatibility between VZ v. 6 and v. 7.


----------



## coreyman (Aug 7, 2017)

What about vzdump and vzrestore, do those work on ovz7?


----------



## ICPH (Aug 7, 2017)

coreyman said:


> What about vzdump and vzrestore, do those work on ovz7?


no, these does not work on VZ7 from what i tried.
/etc/init.d/vz: No such file or directory
Error: OpenVZ is not running on the target machine
"consider switching to pmigrate utility"


----------



## coreyman (Aug 10, 2017)

ICPH said:


> no, these does not work on VZ7 from what i tried.
> /etc/init.d/vz: No such file or directory
> Error: OpenVZ is not running on the target machine
> "consider switching to pmigrate utility"



https://openvz.org/Upgrade_script_from_OpenVZ_to_Virtuozzo_7


----------

