How to back up my entire system and restore on a different machine?
I have a project which needs a lot of packages to be installed (like CUPS, Parse Server, mongoDB, etc) on ubuntu 16.04. My question is : After all installations and configurations, how can i backup the entire system + packages and restore on a different machine?
To explain in few words why i have to do this, is because i have to install this project in each restaurant and i need a different machine with the same packs and settings.
Thx in advance!
Solution 1:
Cloning
I use Clonezilla and there are other tools that are also good for the cloning task.
But here I focus on the setup of the system itself.
OEM setup
Often you do not want identical systems, but different IDs for the computer and the user. This can be achieved with an Ubuntu OEM installation.
The special setup (installed program packages, tweaks etc) is done while running the oem user. Then the special icon on the desktop is used in order to activate the final installation (to run when booted in a target computer), 'Prepare for shipping to end user'.
A [compressed] image of this system is created (with a cloning tool).
A clone is installed into each target computer from the [compressed] image.
Boot the target computer and finish the setup to create computer ID and user ID.
See this link,
help.ubuntu.com/community/Ubuntu_OEM_Installer_Overview
Solution 2:
I have used several cloning software.
As mentioned: Clonezilla works.
I like Macrium
Get everything setup just like you want it: Software, admin account, background, software updates, etc...
Then clone it to an external drive.
You can use a usb flash drive to boot into Macrium and point it to the image on the external hdd.
Takes about 25 minutes on ssd drive for about a 60GB image.
I think there is some open source enterprise level software out there that would help you better for patching, updating an image, etc... but not sure on the Linux side of the house.
User sudodus makes a very valid point on making the image unique, meaning specifically wanting to make sure: Hostname, MAC, IP, Hardware drivers, etc... all get detected correctly on multiple machine installs.
If you have identical hardware for all your multiple install you should be able to just use clonezila, macrium or other imaging hardware and after imaging the machine rename the hosts to unique names. I'm not sure how to change MAC address or if Ubuntu will pick that up on a fresh boot up.
The tool sudodus is talking about "Generalizes" the machine for new installs.I've not used it, but I am sure it does what is similar to building and imgage with Microsoft Deployment Toolkit where base image, drivers, packages, software, updates can all be built into an image for mass deployment.
In a nutshell, I'd use a cloning tool for small projects, and the Ubuntu tool for larger projects or long term projects where you need to maintain or update the images. I say this because setting up a tool, image requires a lot more work where-as a cloning tool can be done in a much shorter time.