In running environment migration of Linux Like we need to migrate A-Server to B-Server
A-server & B-server filesystem have same size & same structure if there is database then it's good to install new database in new server & then restore that database because the starting sector & end sector of a disk may create problem.
A-server is running server in a production environment
B-server is now ready take ownership of A-server
For safer side we have added a 100Gb Lun in Server-B & make filesystem & mount in directory call /TEMP
now first we will take the backup of the A-server through sync command which will put all stuff in /TEMP {Like /,opt,/var etc"
this will take backup from server-B & transfer it to Server-B:/TEMP mount point
10.32.2.103 is the Server-A.
rsync -e ssh -avz -n -X -- exclude-from=/home/exclude.txt root@10.32.2.103:/usr /TEMP/
rsync -e ssh -avz -n -X root@10.100.2.103:/opt /TEMP/
rsync -e ssh -avz -n -X root@10.100.2.103:/var /TEMP/
rsync -e ssh -avz -n -X root@10.100.2.103:/crs/oracle /TEMP/
dry-run
rsync -avz -n -X source file system to destination
when sync required
rsync -avz -X source file system to destination
-X = one-file-system
-n = dry-run
Then We can rsync from server-B:/TEMP to Server-B "/" /var /opt etc
exciude.txt
/boot
/proc
/sys
/tmp
/dev
/var/lock
/etc/fstab
/etc/resolv.conf
/etc/sysconfig/network*
/etc/sysconfig/hwconf
/etc/sysconfig/ip6tables-config
/etc/sysconfig/kernel
/etc/hostname
/etc/HOSTNAME
/etc/hosts
/etc/modprobe*
/etc/modules
/net
/lib/modules
/etc/rc.conf
/etc/multipath*
/etc/binding*
sudo rsync -e 'ssh -p 30000' -azPx --delete-after --exclude-from="/mnt/origin/home/demo/
exclude.txt" /mnt/origin/ root@1.2.3.4:/mnt/destination/