Am I the only one having trouble trying to remember what contribs I installed across my servers?
My contribs are in an ibay but some were installed via a script. So I'm not exactly sure what's installed and isn't installed. Maybe you fall into the same boat.
To list out all rpm's and when they were installed.
rpm -qa --last
Get the list of rpms that are installed and compare to original:
# rpm -qa --queryformat '%{NAME}\n' | sort > rpms_installed
# vi rpms_original (paste in the rpms listed below)
# diff -u rpms_original rpms_installed > rpms_diff
Here you can read rpms_diff for a list of differences.
Everything with a + is added from the original.
Everything with a - is removed from the original:
# cat rpms_diff
Or you can look at just the contribs:
#grep "+[a-z]" rpms_diff
Either remove the rpms manually.
#yum remove <packagename>
Or script the removal.
Can someone help me here? Will this work? Something similar to:
# yum remove grep "+[a-z]" rpms_diff | sed "s/+//" | sed "s/compat-glibc//"
================================================================================================
Using the info above I create a process & procedure for upgrading my servers. I'm posting it as an upgrade guide.
#PROCEDURE GUIDE TO UPGRADE TO V7
#ASSUMPTIONS
-As always, I'm not responsible for lost data. Use at your own risk. YMMV.
-this is a procedure guide for the somewhat expericenced. Not necessarily a step-by-step for newbies.
-the dashes signify a new step. Don't include them in the command. Print out the procedure and checkmark the dashes as you go through the process so you know when the step is completed.
-have old v6 in raid
-you've blocked off 2 hrs of time
#OVERVIEW
-remove all contribs & custom templates from v6
-install all v6 yum packages
-upgrade to v7
-signal-event post-upgrade
-signal-event reboot
###---PROCEDURE-OLDSYSTEM---###
#RE-RAID & BACKUP
-re-raid fully to 100%
-remove drive as a backup
#STOP EMAIL
-/etc/init.d/smtpfront-qmail stop
-/etc/init.d/qmail stop
#GET LIST OF PACKAGE DIFFERENCES
-rpm -qa --queryformat '%{NAME}\n' | sort > rpms_installed
-create rpms_original file (use list below)
-diff -u rpms_original rpms_installed > rpms_diff
#Here you can read rpms_diff for a list of differences.
#Everything with a + is added from the original.
#Everything with a - is removed from the original:
-cat rpms_diff
#REMOVE ALL CONTRIBS NOT ON A V6.0.1 FRESH INSTALL BY PACKAGENAME
-yum remove grep "+[a-z]" rpms_diff | sed "s/+//" | sed "s/compat-glibc//"
#REMOVE ALL CUSTOM TEMPLATES
-remove all templates-custom & templates-user-custom
#REMOVE ALL CONTRIBS NOT ON A V6.0.1 FRESH INSTALL BY VERSIONRELEASE
-rpm -qa --queryformat '%{NAME}-%{VERSION}-%{RELEASE}\n' | sort > rpms_installed_nvr
-create rpms_original_nvr file (use list below)
-diff -u rpms_original_nvr rpms_installed_nvr > rpms_diff_nvr
#Look at the list of differences
-grep "+[a-z]" rpms_diff_nvr
#remove all the packages in the list by hand
-yum remove <packagename>
#Also, if needed, remove the MySQL packages like this.
-rpm --erase --justdb --noscripts --notriggers MySQL-server MySQL-client
#These are the packages I had left over & didn't remove:
+compat-glibc-6.2-2.1.3.2
+openssl-0.9.6m-1es1
+zlib-1.2.1.1-4
#YUM TO LATEST PACKAGES
#just to see the list
-yum list
#install by hand
-yum install <packagename>
#speed up process by installing all packages by letter. For example: yum install p*
#you may have to fiddle around here a little bit. But it shouldn't be that hard.
#RERUN TEMPLATES & REBOOT
-se post-upgrade
-se reboot
#UPLUG FROM WAN
#BACKUP MYSQL TO DB
-se pre-backup
###---PROCEDURE-NEWSYSTEM---###
#EITHER UPGRADE FROM CD (insert CD) --OR-- RESTORE FROM DISK (instructions below)
#I chose to upgrade from CD because in my testing I didn't see any advantages or differences in restoring from disk other than moving to new hardware.
##RESTORE FROM DISK BEGIN##
#REMOVE HD FROM OLD V6
#INSTALL OLD HD IN NEW SYSTEM ON HDA
#CHANGE ALL PARTITIONS TYPE TO LINUX
-boot from KNOPPIX
-open terminal
-su
-fdisk /dev/hda
-t <to change type>
-L <to see hex codes for different FS types>
-83 (i think this is linux, but check in the list to be certain)
-w
-q
-exit
-exit
-reboot
#COPY HD INFO FROM OLD HD (ON HDA) TO NEW SYSTEM
-cd /
-mkdir /mnt/tmp
-mount /dev/hda2 /mnt/tmp
-/sbin/e-smith/db configuration setprop backup Program CopyFromDisk status enabled
-signal-event pre-restore
-signal-event restore-tape /mnt/tmp
-signal-event post-upgrade
-signal-event reboot
##RESTORE FROM DISK END##
###---AFTER UPGRADE PROCDURE---###
#INSTALL NEW CONTRIBS
-print out the list of rpms_diff & decide which ones you want and are available.
#adjust RBL's
-config show qpsmtpd
-config setprop qpsmtpd RBLList sbl-xbl.spamhaus.org,dsn.rfc-ignorant.org,postmaster.rfc-ignorant.org,abuse.rfc-gnorant.org,whois.rfc-ignorant.org,bogusmx.rfc-ignorant.org,dnsbl.njabl.org,relays.ordb.org,dnsbl.sorbs.net,list.dsbl.org
-config setprop qpsmtpd DNSBL enabled RHSBL enabled
-signal-event email-update
-svc -t /service/qpsmtpd
#install lat
-wget http://mirror.contribs.org/smeserver/contribs//jbennett/sme7/lat/e-smith-lazy_admin_tools-0_9_1-0_noarch.rpm
-rpm -Uvh e-smith-lazy_admin_tools-0_9_1-0_noarch.rpm
#adjust forwarded users to forward instead of deliver locally
#(users that forwarded before used a procmail option which isn't available, so it's set to deliver locally)
-lat-dump -d
-adjust the file
-lat-users -a -I <filename>