Mirroring sites with lftp
Sat, 11/17/2007 - 19:45 — sandipThe "mirror" command is all you need to copy/mirror a site with lftp:
$ lftp
lftp :~> connect ftp.domain.tld
lftp ftp.domain.tld:~> login <username>
lftp ftp.domain.tld:~> mirror
Here's a one liner:
$ lftp -e mirror -u <username>,<password& gt; <host>
Migrating sites between DirectAdmin servers
Fri, 02/02/2007 - 10:55 — sandipThese 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.c om/* /home/newuser/domains/domain.c om2/
# chown -R newuser:newuser /home/newuser/domains/domain.c om2
# 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
# cd /etc/virtual
# mv domain.com domain.com.tmp
# mv domain.com2 domain.com
# mv domain.com.tmp domain.com2
Changed user for the imap files.
# find /home/newuser/imap -user olduser | xargs chown newuser:newuser
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
# find /home/newuser/domains -perm 0777 -type d > 777.txt
Migrating website from Ensim Basic 3.1.12-9 to Ensim Pro 4.0.2-7
Sun, 02/20/2005 - 22:08 — sandipThe site migration was done from a server with Ensim Basic 3.1.12-9 (secure) to a server running Ensim Pro 4.0.2-7 (serv01).
-
----- Preparation prior to migration -----
48 hrs prior to migration, edit the SOA settings with the "Refresh Interval" and the "Minimum Time To Live" to 600 for the domains.
Remove frontpage extensions from all sites.
Backup sites on secure (ensim 3.1.12-9) with ensimbackup and move it to serv01.
# ensimbackup -l </path/to/domain_list>----- In serv01 ----- Check to make sure that the default site template has enough databases to assign in pro.
Remove all instances of the domains to be restored in /etc/bind/secure_dns.conf .
Delete all corresponding /var/named/sec.domain.tld files.
# for x in `cat <domain list file>`; do rm /var/named/sec.$x; doneRestart named. Turn sim checking off for webbpliance (init.ocwhttpd off) in "/usr/local/sim/config/mods.co
`service webppliance stop`
Unhide all hidden services.
Restore with ensimprorestore on serv01 (ensim 4.0.2-7.rhel).
# ensimprorestore -a </path/to/dir/>Assign Spam Filter and Mail Scanner and remove ssh and squirrelmail for the restored domains.
# for x in `cat <domain list file>`; do \ # EditVirtDomain -c mailscanner,on -c spam_filter,on \ -c ssh,off -c sqmail,off [-c frontpage,on] $x; doneHide services, `/etc/appliance/svcdb/hide.sh hide` `service webppliance start`
Turn sim checking on for webbpliance (init.ocwhttpd on).
Run `/var/www/html/secureDNS/dns_u
Disable /etc/bind/dnsupdate for 48 hrs.
----- In secure -----
Delete all instances of the domains from the zone list, "/etc/bind/bind.conf.wp".
Delete all corresponding /var/named/zone.domain.tld files.
# for x in `cat <domain list file>`; do rm /etc/bind/zone.$x; done # for x in `cat <domain list file>`; do rm /var/named/db.$x; doneRestart named. Run `/etc/bind/dnsupdate` in secure.
Delete the accounts after 48 hrs.
----- Old Method, use only for reference -----
Create the Reseller Account.
Assign the site to the Reseller account with high security, no squirrelmail (available by default) and no SSH. Also, change the number of database back to the original number... which is normally 1.
Delete corresponding zone records from "/etc/bind/secure_dns.conf".
Add DNS records using "/etc/bind/addZone.sh <domain.com>".
#!/bin/bash # addZone.sh cat <<EOF >zone.$1 zone "$1" IN { type master; file "/var/named/db.$1"; allow-update { key "wp_default_key."; }; allow-transfer { localhost; 216.12.215.205; }; }; EOF cat <<EOF >/var/named/db.$1 \$ORIGIN . \$TTL 3600 ; 1 hour $1 IN SOA ns2.edices.com. admin.edices.com. ( 2005021308 ; serial 3600 ; refresh (1 hour) 600 ; retry (10 minutes) 86400 ; expire (1 day) 3600 ; minimum (1 hour) ) NS ns1.edices.com. NS ns2.edices.com. \$TTL 86400 ; 1 day A 207.44.206.16 MX 10 mail.$1. \$ORIGIN $1. ftp A 207.44.206.16 mail A 207.44.206.16 www A 207.44.206.16 EOF cat <<EOF >>bind.conf.wp include "/etc/bind/zone.$1"; EOF [ -f /var/named/db.$1 ] && chown named:named /var/named/db.$1 && chmod 600 /var/named/db.$1 [ -f /var/named/sec.$1 ] && rm /var/named/sec.$1 echo "Restart named manually if everything looks fine..."Run `/var/www/html/secureDNS/dns_u
Remove Zones in bind via GUI on secure.
Run `/etc/bin/dnsupdate` in secure.
- sandip's blog
- Login or register to post comments