OpenVZ Forum


Home » General » Support » migration?
migration? [message #1491] Fri, 10 February 2006 01:13 Go to next message
Jonathan is currently offline  Jonathan
Messages: 10
Registered: September 2005
Junior Member
Is there a step-by-step migration guide? I'm having a hard time figuring out how to do it...

/vz/root/ only seems to contain files when stuff is running...

I could use some help! Wink

Jonathan
Re: migration? [message #1492 is a reply to message #1491] Fri, 10 February 2006 01:36 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Could you be more specific on what do you want to migrate? A physical system into a VPS, or something different? My magic crystal ball is not showing anything sensible today Smile

Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: migration? [message #1493 is a reply to message #1492] Fri, 10 February 2006 02:09 Go to previous messageGo to next message
Jonathan is currently offline  Jonathan
Messages: 10
Registered: September 2005
Junior Member
My lack of sleep is definitely playing a role here...

Actually, I'm just trying to MOVE a VE on OpenVZ to another OpenVZ server, and I can't find docs on how to do it. Wink

While I'm at it (and since I know you're subscribed to the thread Wink, can you move commercial Virtuozzo VEs onto OpenVZ?

Jonathan
Re: migration? [message #1494 is a reply to message #1491] Fri, 10 February 2006 02:35 Go to previous messageGo to next message
alticon-brian is currently offline  alticon-brian
Messages: 27
Registered: February 2006
Location: Washington, DC
Junior Member
I may be completely wrong, but i'll give it a shot. It should be non-destructive so what the hey.

Try tar-ing up the VPS like so:

tar zcvf ~/newvps.tgz /vz/private/<vpsid> /etc/sysconfig/vz-scripts/<vpsid>.conf

this will create a tar and gzipped copy in your home directory with a copy of the vps config file. move the tgz to a new server, extract it and the move the directory into /vz/private.

Since there is some things that will need to be done with /proc as well you *may* need to create the vps with vzcreate and then move the files into place.

Just a couple of ideas to try until someone with a bit more experience comes along to give you the right answer.
Re: migration? [message #1495 is a reply to message #1494] Fri, 10 February 2006 02:50 Go to previous messageGo to next message
Jonathan is currently offline  Jonathan
Messages: 10
Registered: September 2005
Junior Member
We'll reply with what worked! THANKS!
Re: migration? [message #1496 is a reply to message #1495] Fri, 10 February 2006 03:18 Go to previous messageGo to next message
Gary is currently offline  Gary
Messages: 1
Registered: February 2006
Junior Member
What alticon-brian suggested worked for us.

Basically, we just stopped the VPS, moved over the .conf file, tarred up the /vz/private/VPSID and /vz/root/VPSID directories (the latter just to make sure the directory existed on the new system) and then started the VPS on the new system. Connectivity seems fine and there haven't been any obvious problems.

Also, we renamed the .conf file on the original server to VPSID.migrated - keeping it around can cause warnings about the VPS's IP being used by another system on Commercial Virtuozzo at least, so we figured it best to just rename the file.
Re: migration? [message #1509 is a reply to message #1494] Fri, 10 February 2006 13:51 Go to previous messageGo to next message
jbond007 is currently offline  jbond007
Messages: 78
Registered: January 2006
Location: Miami
Member
Great !!!!!
after you tar how can you uncompress /

to keep same folder permission
thank you
please show the sample
you the best
Re: migration? [message #1513 is a reply to message #1491] Fri, 10 February 2006 16:22 Go to previous message
alticon-brian is currently offline  alticon-brian
Messages: 27
Registered: February 2006
Location: Washington, DC
Junior Member
To untar that stuff run the command "tar zxvf ~/newvps.tgz". That will extract the information in the tar file to the current directory you are in with the full path (versus "tar zcvf ~/newvps.tgz" which created the tar/gzip). So if you're in /tmp you would end up with directories like:

/tmp/vz/private/<vpsid>/<vps filesystem>
/tmp/etc/sysconfig/vz-scripts/<vpsid>.conf


and would run the command (with the VPS stopped):

# This is to back up the base VPS created by the vzcreate command on the new machine
# changing the name from <vpsid> to <vpsid>-orig (i.e. 100 becomes 100-orig):
mv /vz/private/<vpsid> /vz/private/<vpsid>-orig 


# This backs up the conf file in the same way:
mv /etc/sysconfig/vz-scripts/<vpsid>.conf /etc/sysconfig/vz-scripts/<vpsid>-orig.conf


# This moves the VPS data into the proper place:
mv /tmp/vz/private/<vpsid> /vz/private/ 


# This puts the configuration file back in place:
mv /tmp/etc/sysconfig/vz-scripts/<vpsid>.conf /etc/sysconfig/vz-scripts/<vpsid>.conf



Also, check out
tar --help
There is a lot of awesome flags that can be used with it to make your administrative life easier.
Previous Topic: 022stab064.1 source patch seems to cause "check_stack_overflow" in irq.c
Next Topic: Debian OS Template
Goto Forum:
  


Current Time: Sat Nov 02 22:09:32 GMT 2024

Total time taken to generate the page: 0.03632 seconds