Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
xhost:migration-web [2020/02/10 19:29]
admin
xhost:migration-web [2020/02/17 08:31] (current)
admin
Line 2: Line 2:
 A good start is to go through apache2 config: A good start is to go through apache2 config:
  
-   grep ^Use domains.conf |cut -f4 -d\+   grep ^Use domains.conf |cut -f4 -d\ |sort >/​tmp/​d.txt
        
 for a small number of domains, it is pretty quick and 100% correct going through the list manualy for a small number of domains, it is pretty quick and 100% correct going through the list manualy
 <code bash> <code bash>
-   ​domains = `grep ^Use domains.conf |cut -f4 -d\ | xargs`+   ​domains=`grep ^Use domains.conf |cut -f4 -d\ | xargs`
    for i in $domains; do    for i in $domains; do
       host $d       host $d
Line 15: Line 15:
    done    done
 </​code>​ </​code>​
 +
 +Or automaticaly:​
 +<code bash>
 +for i in `cat /​tmp/​d.txt|xargs`;​ do
 + host $i 8.8.8.8 |grep 146.255 -q || echo $i >>/​tmp/​dead.tmp;​
 +done
 +sort /​tmp/​dead.tmp >/​tmp/​deads.txt
 +</​code>​
 +    diff -u /tmp/ds.txt /​tmp/​dead2.txt |sed -n '​s/​^-\(.*\)/​\1/​p'​ >/​tmp/​alive.txt
 +
 +Generate the domains again
 +   diff -u /​tmp/​ws2.alive /​tmp/​ws.dead | sed -n '​s/​^-\(.\)\(.*\)/​Use VhostCGI \1 \1\2/​p'​
  
 Save this list for later editing the DNS. Save this list for later editing the DNS.
 +
 +
 +2. remove dead databases
 +<code bash>
 +cat /​tmp/​ws2.alive |tr -s . _ |sort >/​tmp/​db.alive
 +ls -1 /​var/​lib/​mysql/​ > /tmp/db.old
 +domains =`diff -u db.old db.alive | grep ^-|tr -s _ .|cut -f2 -d-`
 +
 +for i in $domains; do host $i|grep 146.255.31.12 -q && echo $i; done >> /​tmp/​db.alive
 +   sort db.alive >​db2.alive
 +These are dead 
 +
 +   diff -u db.old db2.alive | sed -n '​s/​^-\(.*\)/​drop database \1;/p'
 +</​code>​
 +
 +Change DNS
 +a) those who has dns at us
 +<code bash>
 +   cd /​mnt/​swraid/​conf/​bind/​domains_master
 +   sed -i '​s/​146.255.31.12/​167.233.3.19/'​ *
 +</​code>​
 +b) the rest - contact by email
 +
 
xhost/migration-web.1581359391.txt.gz · Last modified: 2020/02/10 19:29 by admin