--- Migrate to OEL8 ---


FIND THE SERVICE RUNNIN ON SERVER
systemctl | egrep 'appworx|badm|banjob|cbagent|commvault|httpd|jenkins|mysql|mariadb|nginx|oni|oracle|oussm|postgres|rabbit|snapd|tomcat|avahi|graylog' | cut -c1-90 | egrep -v 'apparmor|target|seeded|socket|mount|session|smart|stat|user|lvm'  | sort -u | awk '{print "systemctl status "$1}'

CHANGE THE IP
nmtui 
	Modify the entry that exists
        Add a new ethernet connection with the proper details

REGISTER THE SYSTEM

/usr/bin/rhn_register
rhn_register CSI:15993512
login as        : mhizny@binghamton.edu
pass            : RunToTheHills283474@


Run yum update

INSTALL if needed and TEST Autofs
Find mount points
use df -h AND df 

**Installed Python3.8.15 from source from the original
Susquehanna system.
   ./configure –prefix=/usr
   Make;make install

USE FDISK TO CHECK FOR DISK

fdisk -l | grep /dev/sd

pvcreate /dev/sdb2
vgcreate -v VolGroup01 /dev/sdb2

CREATING AND MOUNTING DISKS
df -hT | egrep [ul]0[0-9] | egrep mapper | awk '{print $1" "$2" "$3" "$7}'

Use scrpts to create file system
mk-lvcreate.sh  
mk-lvcreate.sh 
mk-mkfs.sh  
mk-mp.sh  
mk-LABELS.sh  
mk-fstab-entry.sh  

Install autofs
yum install autofs

SETUP AUTOFS
This should iusolate the mount points (double heck)
df -h | egrep -v '[ul]0[0-9]|tmpfs|boot|mapper'


mkdir /apps
cd /u01/app


REMOVE FROM WHERE ??
rm -rf badm 
ln -s /apps/badm

cd /u01/app/banner
rm -rf bgm
ln -s /apps/bgm

cd /u01/app/banjob
rm -rf gurjobs
ln -s /apps/gurjobs

mkdir /banner
sudo ln -s /u01/app/banner_xe/bmui_staging /banner/dist

restart autofs


TOMCAT - FROM WHAT SOURCE or LOCATION
Install tomcat
yum install tomcat

Copy over /u01 (which is where the tomcat files are located)

FIND WHAT TOMCAT INSTANCES ARE RUNNING
systemctl | egrep tomcat



systemctl start tomcat
systemctl enable tomcat

Install java
yum -y install java-1.8.0-openjdk java-11-openjdk

Copied over the passwd group and shadow files

INSTALL HTTP
yum install httpd


INSTALL PHP
yum install php

INSTALL POSTFIX

yum install postfix
## get  /etc/postfix/main.cf from server

systemctl restart postfix

dnf install -y mailx
hostname=$(hostname -f)
$hostname -s "Test email subject"
chouck@binghamton.edu,samoore@binghamton.edu

If the email does not appear, you can check the Postfix mail
queue:
sudo mailq
You can also check the Postfix log. Press Ctrl + C to exit:
sudo tail -f /var/log/maillog

DISABLED VIRBR0
virsh net-undefine default
virsh net-destroy default
virsh net-autostart default --disable
chkconfig libvirtd off
systemctl disable libvirtd.service

DISABLED SELINUX
vi /etc/selinux/config
change SELINUX=disabled

CONFIGURE NFS

INSTALL EXTRA PACKAGES
yum install expat expat-devel \
gmp-devel \
openldap-clients \
openldap-devel \
libxml2-devel \
bzip2-devel \
readline-devel \
libxslt-devel \
pam-devel \
libcurl-devel \
openssl-devel


COPY OVER TOMCAT STARTUP FILES
systemctl | egrep tomcat | cut -c1-90 | awk '{print "ls -l /etc/systemd/system/"$1}'  | sh

cd  /etc/systemd/system/
sftp root@
  cd  /etc/systemd/system/
   get /etc/systemd/system/tomcat-*.service
 
STOP THE SERVICES ON ORIGINAL SYSTEM

COPY DATA FROM DISKS
#cd /home; /bin/gtar cpf - * | ssh root@128.226.###.## "(cd /u01; /bin/tar xpf )" NOTE: Had to copy the directory /home/oracle/.wlst over to new
#cd /u01; /bin/gtar cpf - * | ssh root@128.226.###.## "(cd /u02; /bin/tar xpf -)"
#cd /u02; /bin/gtar cpf - * | ssh root@128.226.###.## "(cd /home; /bin/tar -xpf)"

USE RSYNC TO GET UPDATED DATA FROM DISKS
***NOTE CHECK ON THESE COMMANDS…
rsync -av /home/oracle 128.226.136.34:/home/oracle
rsync -av /home/banner 128.226.136.34:/home/banner
rsync -av /home/badm 128.226.136.34:/home/badm

INSTALL HTOP
yum install https://dl.fedoraproject.org/pub/epel/epelrelease-latest-8.noarch.rpm
/usr/bin/crb enable
yum install htop

ADD TO THE FIREWALL
sudo firewall-cmd --zone=public --permanent --addport=9184/tcp --zone=public

COPY OVER STARTUP FILES
gcstartup, Jenkins-agent, lockgcstartup, oracle_init,
unlockgcstartup
STOPPED THE CRON
systemctl stop crond
systemctl disable crond
COPY CRON AND MAIL FILES
rsync -avzxHS --log-file=/var/tmp/cron-sync.log \
-e 'ssh -xT -o Compression=no' \
/var/spool/cron/* 128.226.136.28:/var/spool/cron/
rsync -avzxHS --log-file=/var/tmp/cron-sync.log \
-e 'ssh -xT -o Compression=no' \
/var/spool/mail/* 128.226.136.28:/var/spool/mail/

REMOVE COCKPIT
systemctl stop cockpit
rpm -e cockpit-system
rpm -e cockpit-bridge
rpm -e cockpit-ws

SWAP HOSTNAME AND IP BETWEEN THE TWO SERVERS

Valid HTML 4.0 Transitional