Rhel 7, how to save/export configuration
Posted by rebirthofmonse@reddit | linuxadmin | View on Reddit | 25 comments
Good morning all,
I'm working on RHEL 7.9 servers and need top upgrade to RHEL 8.x but my IT team doesn't upgrade but reinstall everything.
I fear some configuration will be lost.
Which commands or files can I use to export/save my setups? (kernel, network params...)
Thanks
root-node@reddit
You should look into automation and stop treating your servers as pets.
We build and tear down servers all the time, dumping down all the configuration and software required every time.
locke-monster@reddit
We’re in the middle of upgrading our older CentOS systems to Rocky. What tools do you recommend we look at? Thanks
root-node@reddit
Ansible
captkirkseviltwin@reddit
This is critical; it's a lot of work upfront, but constantly pays for itself every time you have to upgrade or replace something.
Sad_Dust_9259@reddit
I usually just back up /etc, save output of rpm -qa, sysctl -a, and grab the network-scripts dir plus crontabs. That covers most custom stuff before a reinstall.
H3rbert_K0rnfeld@reddit
This is a java app disappearing in the making
xscori@reddit
AFAIK, RHEL does not support in-place upgrade from RHEL 7 to 8 etc.
carlwgeorge@reddit
It does.
https://www.redhat.com/en/resources/leapp-explained-detail
jacobamey@reddit
I agree with your IT team. New Machine (Might as well go to 9) 8 is already EOL unless you have some sort of extended contract.
RSYNC is your friend for moving data over. Configuration setups should be documented... right... RIGHT!
Some have said bellow that this would be a good time to get this server configuration into an Ansible role or something similar. I agree.
Unless you have a weird setup, I doubt you have special kernel and network parameters that would need to be brought over. Instead ensure configs reference DNS or localhost if local. (Database excluded here, update the IP/subnet grants) That way you can just flip DNS when you are ready to cutover.
Able-Ambassador-921@reddit
everything from /etc and below
export your rpm list as well as all services set to start on boot
a crontab list might be useful with any custom script.s
Sigfrodi@reddit
/var/spool/cron for crontabs.
rebirthofmonse@reddit (OP)
Thanks
Connect_Potential-25@reddit
You may also want to look for custom directories under /, and at /root, /var, /opt, /srv, and /usr/local for things like web pages, file shares, SELinux policies, and custom scripts/source code/binaries. You may have important things in /home if your org runs service accounts that have home directories there for whatever reason. You may want to archive the server's logs too depending on how your org handles logging.
ISortaStudyHistory@reddit
Sounds like there's no config mgmt
stoltzld@reddit
You can use rpm --verify to list changed files (like changed config files). Back when I worked with redhat derivatives more, I had a script that listed changed files and orphans.
The_Real_Grand_Nagus@reddit
Depends on what you have installed. /etc is the obvious place, but there's also potentially stuff under /usr/local, /opt, /home, /root, and /srv that you might want to save off. Any custom software or mounts. I'd probably save off /var/log too.
rayzerdayzhan@reddit
There’s no official upgrade path from 7 to 8 that’s why they’re reinstalling. Have a backup of the entire system, including /etc, /home, and /var. most config is in /etc but you may need other stuff not in /etc.
doomygloomytunes@reddit
Kinda wrong because Red Hat supports upgrading with leape.
With that said its only recommended to upgrade a server in place if it's not hosting some third-party software not available in the repos. Enterprise software is generally on a specific version of an operating system because it's certified and supported on that OS version. Upgrade the OS and breakage usually occurs so migration to a new build is almost always the best most stable option.
If you're not managing your server's config in some way OP then time to start.
Hotshot55@reddit
Leapp*
doomygloomytunes@reddit
Oops, corrected
Hotshot55@reddit
That is 1000% wrong.
rebirthofmonse@reddit (OP)
Ok, thanks
dhsjabsbsjkans@reddit
When I have done this in the past, I usually build out a new machine, we then copy over home directories, crontabs, etc from the old to the new server. Once everything we can think of is copied over, we shutdown the old machine. We then rename and re-ip the new machine with the original hosts values. Then we have people test. If something is missing or doesn't work, we can fail back to the original host.
After you do this a few times, you find out what you need.
Burgergold@reddit
It depends what you have installed on it
Now is a good time to automate with an ansible playbook or write a good doc
jlrueda@reddit
sosreport