Solved

export linux system settings to clone configuration

Posted on 2014-12-09
14
174 Views
Last Modified: 2014-12-12
Hi,
I want to know if there is a way to export all system settings from a linux box which can be later scripted to setup a new system?
I want all the system settings to be included.

Regards,
A
0
Comment
Question by:Ackles
  • 9
  • 4
14 Comments
 
LVL 11

Expert Comment

by:andreas
ID: 40488395
IT depends on what you want to do.

Re-Setup same version of linux on just another box, then its quite easy. many distros have tools for this purpose. You should at first give  little more details of what you want to perform exactly, with which version(s) of Linux.
0
 
LVL 11

Author Comment

by:Ackles
ID: 40488399
CentOS
0
 
LVL 11

Expert Comment

by:andreas
ID: 40488403
CentOs, same version to same version? Oldversion to new version? Which is your current version you are using?
0
 
LVL 11

Author Comment

by:Ackles
ID: 40488411
Currently its 6, but it could also be possible that we want to go for newer version
0
 
LVL 11

Accepted Solution

by:
andreas earned 500 total points
ID: 40488415
If its same version to same version you have the follwoing possibilities.

Re-Setup a basic version of CentOS on the new machine.
Then on the old machine build a list of installed packages.

rpm -qa > installed-software.log

on the new machine install these packages.
Repository configuration needs to be the same on both machines. repos can be found here:

/etc/yum.repos.d/*

and need to be the same on both machines (you need to copy the files over)

yum -y install $(cat /home/user/installed-software.log)

after that you need to copy over the contents of /etc/ to the new machine and you should be finish.

Attention, this only works flawless if hardware and Installed CentOS ist the same.
Some files like grub related and fstab should NOT be copied over as it will damage the system.

If hardware is different you need to be careful when copy over the content of the /etc dir, not to destroy all the files
necessary and individual to the new hardware.

If this is too complicated and you realyl have same hardware, you might use tools like clonezilla to mirror the clone system to the new hardware. this will make a true 1:1 copy but is not a new install with same settings as in your original question.
0
 
LVL 11

Expert Comment

by:andreas
ID: 40488487
For a newer version you need to do more work,

the trick with syncing the packages might not work as sometimes packagenames change.

In this case if you want to switch to 7 you need to re-setup by hand, install all necessary software and copy config files of this packages. Sometimes the config files change options in newer releases so this will not always work and really depends on what software you are trying to migrate.
0
 
LVL 11

Author Comment

by:Ackles
ID: 40488491
Thanks, I will Test it.
What about Network & firewall settings?
I am trying to stimulate that I can have all the config taken out of active system, so just in case if there is a failure I can quickly setup a new system with same configuration.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 11

Expert Comment

by:andreas
ID: 40488523
you best save contents of

/etc/

configs, etc.

/var/

e.g. databases.

Network settings are in files sitting in /etc/

firewall settings depending on what kind of firewall you are using. we use our own scripts here so ive no idea where and what the defaults for CentOS are exactly. But I'm guessing they are also somewhere in /etc/... As far as I remember, there are several different firewalls provided on RedHat based distros.
0
 
LVL 11

Expert Comment

by:andreas
ID: 40488534
For the scenario of a sudden need of resetup i really would suggest you use images.

As its much much faster as the other approach.

But it might not work if you need to clone to totally different hardware. If hardware is slightly different you can fix the clone after the image was cloned to the new hardware. This fixing mainly to fix the grub configuration, sometimes fstab and the drivers necessary for network, graphics(X11 if any), etc.

e.g. hardware to new to run CentOS 6, or disks cant be partitioned the same way on the new machine as the configuration is different (RAID controllers, SSD vs HDD, etc. pp)
0
 
LVL 11

Author Comment

by:Ackles
ID: 40488719
we have VM's so in case of failure, the hardware will always be same.
That is why I was thinking to have everything exported & make it automated....

Your thoughts?

A
0
 
LVL 11

Expert Comment

by:andreas
ID: 40488725
If you VMs its fine, then you can create an identical machine and just clone it with clonezilla.

its a 1 to 1 copy with identical configuration, Network, Packages, Firewall and apps.

Only for an upgrade to CentOS 7 you need to manually reinstall, install proper packages and copy over the configs of the services you are running.
0
 
LVL 11

Expert Comment

by:andreas
ID: 40488728
depending on how you run your VMs you also could just clone the settings and the disk container of that server on the HOST machine that runs the VMs. This way is totally independent from the OS inside and you even dont need imaging tools.

A re-setup in a VM is wasted energy if you just want desaster recovery. use the tools the VM environment is offering.
(snapshots, machine cloning,...)
0
 
LVL 48

Expert Comment

by:Tintin
ID: 40490347
What type of VM are you using?
0
 
LVL 11

Expert Comment

by:andreas
ID: 40497052
virtualbox
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now