Cloning Bare Metal Server With Virtualmin

Any advice on this would be appreciated. I will be as clear and concise as I can.

The background is, that I have one website and use Virtualmin as my control panel. I switched from Cpanel years ago and have never looked back, so kudos and thanks to the team for providing this amazing product.

Data integrity is not critical, since my site is niche and free, losing a few hours or even a few days worth of data would not be the end of the world. The site had ran for years without any reall need for intervention, but all good things come to an end. The developers of the script I used decided to cease support for it and produced a new version built on new technology. Obvioulsy as updates and pacthes were now not being worked on, my site began to break, to the point I was forced to upgrade.

So I started the process of upgrading not just the script but PHP and various other applications. Inevitably things now work differently, with a whole new set of dependancies and a learning curve for me. I am now at the point where I will be hiring a freelancer to fix some script issues but also optimize the server in terms of PHP, Cache and MySql. At some point we need to pay for services and with time constraints on me, this is the way ahead.

I realize of course should I need to reinstall the server, I will lose a lot of the work that will have been completed and have to pay for it all over again. This is not ideal, so I decided to research backing up the entire server. Now this is initally a disaster recovery back up, therfore I would be restoring to the exact same server, using the exact same OS and base configurationn including the same IP’s.

According to the archlinux wiki, I should be able to acheive this using rsync from '/ 'and excluding directories such as dev, proc, sys etc

This would be perfect for me, my proposed disaster recover would use Rsync and a bash script that would perform the following:

Create a ‘pernamanet folder’ - I would have the entire OS and Website copied over.
Hourly - Rsync would update this folder on the website only (not the OS)
Daily - Rsync would update this folder, again website only (not the OS) - once very 24 hrs
Weekly - Rsync would update this folder on a weekly basis

If I had to reinstall for any reason, I could simply rsync the data in the pernament folder over, essentialy doing the above steps in reverse and then choose which backup of the website I wanted to use, i.e hourly, daily or weekly and again use rsync and copy it over.

Can anyone see any issues virtualmin might have with this or foresee any problems?

Another interesting question would be, if I wanted in the future to move hosts and say, rent a server with the same or greater resources, would it be possible to do the same proceedure? Lets say I used the exact same OS version and disk configuration, what problems might occur? I can think of SSL certificates and of course the new server would then use different IP addresses, would those issues be easy to over come by editing virtualmin configuration files?

I know this is a little long winded, and I would be very grateful to anyone that could provide some input and / or advice.

It’s good that you are considering these things. Whatever method you choose, be sure to test it regularly. There’s also some virtualmin documentation on migrating servers that you may find useful.

https://www.virtualmin.com/documentation/system/migrate