[CentOS] A question about 7

Tue Jan 14 21:49:31 UTC 2014
Warren Young <warren at etr-usa.com>

On 1/14/2014 13:41, Les Mikesell wrote:
>
> It seems like taking the list from 'rpm -qa' on a
> running machine and feeding it to 'yum install ....'

I suspect it's not actually that simple.  I think you'd need to do a 
fair bit of processing on the rpm -qa list to be able to build a yum 
command that will succeed.  Consider the RPM "provides" mechanism, which 
allows two different RPMs to provide the same capability under different 
names.  {redhat,centos}-release is this way, for example.

One of the reasons I'm playing with RHEL 7 right now is that my end 
purpose is to be able to modify the documentation and scripts our system 
installers will use to build new CentOS 7 systems.  So, I'm already 
recording all of the changes needed, partly on paper, partly in a 
Subversion repository.  My RHEL 7 VM is disposable.

> then you need to find all of your
> locally modified config files.

Whenever I'm faced with a system with unknown changes which has to be 
nuked and rebuilt, I tar up /etc, /home, and *maybe* /var and/or 
/usr/local.

I usually don't bother with /var, since the irreplaceable things under 
/var get backed up separately: DB tables, the web tree, etc.

There are exceptions.  The Bind zone files on the primary DNS server are 
essentially unique, for example.  (The cached version on the secondary 
DNS server(s) isn't identical to the primary copy.  It's stripped of 
comments, the formatting is a bit different, etc.)

I scp the backup tarball off to a file server somewhere, then replace 
the hard drive and start fresh.  The extra HDD and disk space for the 
backups are cheap insurance.

The replaced HDD can be given another mission once you're satisfied that 
everything's migrated.  Put it in an external USB case and use it for 
the new system's off-site backup, for example.

> Most of that should be under
> /etc/sysconfig for an easy diff, but not everything.

Not a lot of things.  I regularly modify things under

     /etc/ssh/
     /etc/httpd/
     /etc/pki/
     /etc/{init.d, rc.d}/   (via chkconfig and yum)
     /etc/yum.repos.d/
     /etc/samba/

Plus there's plenty at the top level that changes occasionally:

     /etc/{hosts,services}
     /etc/{group,passwd,shadow}
     /etc/sudoers

No, I'll stand by my current practice: tar up all of /etc and /home, at 
minimum.