tips‎ > ‎

System to System Migrations

Data Copys

Rsync is your friend

Normally i use rsync like so :

create a migration script named the same as the hostname your migrating :

#/bin/bash
system=`basename $0`
targetdir="/cs_migration"
if [ ! -d ${targetdir} ];then
 mkdir -p ${targetdir}
fi
if [ ! -d ${targetdir}/logs ];then
 mkdir -p ${targetdir}/logs
fi

/usr/local/bin/rsync -avvr  -e "ssh -c blowfish"  --rsync-path=/usr/bin/rsync root@${system}:/ ${targetdir}/${system}|tee /${targetdir}/logs/${system}.log


This will create a target dir and logs , perhaps put the script into $targetdir/scripts

now create a wrapper script that calls your migration scripts :

(cs_migration is used as my example)

#!/bin/bash
/cs_migration/scripts/fubar2
/cs_migration/scripts/fubar3
/cs_migration/scripts/fubar4
/cs_migration/scripts/fubar6
/cs_migration/scripts/fubar7
/cs_migration/scripts/dev01
/cs_migration/scripts/dev02
/cs_migration/scripts/dev06


execute this via at or cron




Comments