创build我的服务器的副本

我有一个VPS与Plesk运行Debian,我用它来主办一些我的和客户的网站。

我想知道创build服务器备份的最佳方法是什么,所以如果主服务器(VPS)发生任何事情,我可以将DNS名称服务器指向重复的服务器,并保持它运行,直到另一个被修复。

基本上我想创build一个虚拟机(使用virtualbox),这将是非常类似于我的原始服务器。

下面的步骤在debian-ubuntu系统上为我工作。

* Create a virtualbox guest , with appropriate disk and memory calculation on the target. * Install the debian OS. Just the OS only with ssh and network configured. * Keep one or two terminals open on your new virtual box. * Sync all the files from your source to new virtual guest , like shown from the original server rsync -vaP --archive --delete --numeric-ids --one-file-system --exclude=/proc --exclude=/sys / Virtual_Guest:/ * Post changes before you reboot. a> Change your networking information back to virtualbox settings. b> Change your fstab entries. c> run "update-grub" , depends on what debian flavor d> Remove the appropriate udev rules. Eg:- /etc/udev/rules.d/70-persistent-net.rules e> check your /etc/hosts. f> Check anywhere you hardcoded the original name and ip. * Reboot the box. You should have the clone of the original server. Again make sure to check your application configurations to point to the new name and ip of the virtual box. 

由于您的硬件可能不同,因此在使用您计划的成像解决scheme时可能会出现很多问题。 这就是为什么我会build议成像解决scheme只能返回和恢复到完全相同的系统。

备份实际需要的数据(这可能是数据库,网站和邮件数据)会更容易,甚至可以使用plesk集成备份function。 然后,您可以使用相同的plesk版本预先configuration另一台计算机,如果出现问题,您只需恢复plesk备份并更改DNSlogging即可。