These are some basic notes for reference just in case I need to do the migration thing again!!!
Steps taken on the old server
Created a new reseller account.
Created sites in the new reseller account as domain.com2 for the domains that needed to be migrated. DA won't let you add the same name twice, which is why I used a different one for the time being. Doing this will setup all the required files/paths needed to use the website.
Copied the files to the new domain.
# cp -pR /home/olduser/domains/domain.com/* /home/newuser/domains/domain.com2/
# chown -R newuser:newuser /home/newuser/domains/domain.com2
Did a search for the old file path and updated it to the new file path.
# for x in `find /home/newuser/domains/*/public_html -type f -print0 | xargs --null grep -l /home/olduser`; do perl -pi.bak -e 's/\/home\/olduser/\/home\/newuser/g' $x ; done
Swapped around the the email folders.
# cd /etc/virtual
# mv domain.com domain.com.tmp
# mv domain.com2 domain.com
# mv domain.com.tmp domain.com2
Copied over the imap files. Any data in /home/olduser/imap needed to be copied over. There will also be permission issues as well, but can be fixed afterwards with the set_permissions.sh script.
Changed user for the imap files.
# find /home/newuser/imap -user olduser | xargs chown newuser:newuser
Renamed the existing domains with a suffix of ".old".
Renamed the new domains to domain.com from domain.com2.
Logged in as reseller and created a backup.
Created a script and dumped out single databases.
#!/bin/bash
# dbExport.sh
OLD_DB=(
db1
db2
db3
...
)
for ((i=0; i<${#OLD_DB[@]}; i++))
do
mysqldump --opt -u root --password={psswd} ${OLD_DB[$i]} > ./db/${OLD_DB[$i]}.db
done
Did a search and created a list of folders with 777 permission set.
# find /home/newuser/domains -perm 0777 -type d > 777.txt
Setup dns for each domain with a www1 A record to point to the new server IP. Better solution, would be to edit the local hosts file for testing purpose.