We packaged up a RPM when our software was first deployed, we were very new to RPMs so we just defined all the files that need to be installed and it was done part of rpm install.
Fast forward 6 months later, we need to update this RPM. Here are the challenges we are facing:
rpm update will uninstall all the files of the previous RPM before installing new ones. Some of these files are configuration files, we would rather back them up first before uninstalling it
We didn't have %preun and %postun defined in the first RPM
After googling around, the only idea we have is to write a dummy RPM that requires the version of the first RPM. The dummy RPM will simply backup the files. We will them uninstall the first RPM and install the new RPM, which %preun and %postun are defined.
I'm curious if there better ways to do this? Our application environment is sure to evolve and I would like to hear opinions from other professionals on this.