Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


"Cloning" a VPS?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

"Cloning" a VPS?

LongShotLongShot Member
edited October 2011 in General

Can you exactly reproduce one existing VPS onto another, just as you would "clone" a hard drive? This would be useful for creating a fallback or backup system, or moving from one location/provider to another.

The solution that comes to mind is running rsync at the root directory, but this would probably be undoable at best and disastrous at worst. Is there another program that works? Can this be done in effect by copying only certain directories? Thanks!

Comments

  • I actually wouldn't want to. The hardware would be different and therefore the drivers as well.

  • MrAndroidMrAndroid Member
    edited October 2011

    drmike said: I actually wouldn't want to. The hardware would be different and therefore the drivers as well.

    Well, on OpenVZ you can just vzdump or just tar your container, on KVM you can just copy the HD image, although I haven't tried it.

    Linode have tutorials on how to move another VPS over to them, but it will most likely be similar for other host's.

    http://library.linode.com/linode-platform/migration

    I'd imagine if its the same OS and arch, I don't see an issue why rsyncing everything but /proc and /dev

    Thanked by 1djvdorp
  • My code and database is the only thing I need. My sites are handled by git version control and I have backups of the database. Then I just need a script to automate my installs and presto!

    The only thing I don't like is having to update TXT, IP, etc... records.

  • yomeroyomero Member
    edited October 2011

    @Xeoncross A DNS with a good API may solve that I guess. Any idea?

  • @yomero I'm using namecheap Free DNS for all my domains. They provide API as well.
    Most of my domains are registered somewhere else so that they have free private registration, I just use namecheap's NS. It is good enough for me.

  • Go59954Go59954 Member
    edited October 2011

    There is also a small problem of your IPs, though it may be just simple to do, it depends of how many services you use needs IP configuration for it's own, even if you are using Directadmin or Kloxo I've seen complaints for those too when I googled for it that after restoring nothing works anymore, it will need to be updated, so I guess if you did you have to make sure what needs to be configured to use the new host IP.

  • Go59954 said: There is also a small problem of your IPs

    Yes, that was what I was talking about. The DNS and server stuff needs to know the new VPS IP - but also the web API keys I use for different services.

    All-in-all, it's not like you can just "restore" a full image and be done. If you were doing anything important on that box you have to update the rest of the "location" references (on your box and off).

  • kiloservekiloserve Member
    edited October 2011

    LongShot said: Can you exactly reproduce one existing VPS onto another, just as you would "clone" a hard drive?

    Yes it can be done, just ask your VPS provider to do it for you. All 3 of Xen/KVM/OpenVZ are very portable but it must be copied at the node level and your VPS should be shut down to get the exact clone.

  • how to do that?
    the vps guest couldn't generate a hd image.

    i would like to learn how to do that.

  • KuJoeKuJoe Member, Host Rep

    @jaxyan said: how to do that?

    It all depends on the virtualization type and storage type. For OpenVZ it's can be done with a simple vzdump (just restore the dump file to a new container ID). LVMs (some Xen and KVM instances) can be "cloned" with the DD command. There are other storage types that use "image" files (raw, vmdk, qcow) and I'm sure most of them can just be copied and renamed.

  • Standard VZDump of the container would work for OpenVZ, I am not secure on Xen/KVM though.

    I'm assuming you have a "static" website and want to run multiple copies of the content so for a example: 'server 1 goes down' , 'server 2 kicks in'. etc.. etc..
    That would require the database being hosted somewhere offsite.

  • Mon5t3rMon5t3r Member
    edited January 2012

    mentioning @miTgiB for talking about his "snapshot" things.. :P

Sign In or Register to comment.