I would like to have a couple of VPS servers with identical configuration and software. Is there any chance to do something like this? :

  • install one server
  • do some sort of a backup
  • get another blank server
  • restore the backup from the first server
  • modify some files like hostnames and such

Is that possible to do? Right now i'm backing up my server files as follows:

tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys /

But i'm not sure if restoring this on another system would do any good. And it would probably overwrite some files that are server-specific.

Thanks for your thoughts

1 Answer 1


Yes you can do it that way, as long as you are careful. The nice thing about a virtual machine is if you do mess it up, it's just a few clicks to restore it to the default state.

A few notes:

  • You'll probably also want to exclude /var/run
  • Be sure to edit at least the network configuration files before restarting the server, or you will cause IP address conflicts and/or get locked out of the machine
  • Ideally do the restore with the server running from a rescue mode - most VPS's offer a mode for restoring and emergency repairs that functions like booting it from a livecd. Just mount your partitions and do the restore from the rescue mode.
  • Hostnames will need to be changed.
  • SSH keys for the ssh server should be regenerated.
  • Thanks for your answer, Grant. Do you by any chance know which files exactly i should keep from the old server instead of owerwriting from the new one? I know that these will probably include "/etc/hostname", "/etc/network/interfaces", but that's where my knowledge runs out.
    – Marius
    Mar 21, 2013 at 15:20
  • Those are the only two I'd exclude outright - but others will probably need some modifications for the new hostname/ip address. Web and email servers come to mind as needing some changes. But I'd copy those files and then edit the addresses to make sure all other settings stay the same.
    – Grant
    Mar 21, 2013 at 15:29
  • Web and mail is no problem, since i'm familliar with those. Didn't know about the system files though. Thanks, Grant.
    – Marius
    Mar 21, 2013 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.