The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MigrateMe 1.0

Discussion in 'General Discussion' started by beehave, May 4, 2007.

  1. beehave

    beehave Well-Known Member

    Joined:
    Jun 26, 2005
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    16
    Script is now out of date and causing server issues. Do not use!

    Thanks!
     
    #1 beehave, May 4, 2007
    Last edited: Nov 1, 2008
  2. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    697
    Likes Received:
    1
    Trophy Points:
    18
    Great idea! It's like the existing cpanel transfer utility, but with the extra ability to update the IP address in DNS after the transfer...

    Maybe cpanel can take a look at your code and add this option into their transfer utility? ;)

    Cheers!
     
  3. beehave

    beehave Well-Known Member

    Joined:
    Jun 26, 2005
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    16
    MigrateMe 2.0 now available!

    Major upgrade here.. Script does more error checks and prepares a status report when done.
     
  4. ekhwan

    ekhwan Active Member

    Joined:
    Aug 12, 2006
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    I want to migrate all my accounts from an old server to a new one. Can you please write a step by step guide on how to use this script, I mean after installing how is it run and all the other details. Will be helpful to me and many others like me.

    Thanks
     
  5. beehave

    beehave Well-Known Member

    Joined:
    Jun 26, 2005
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    16
    Once you've installed as above on BOTH servers, then start script on new server with the command "mig -b" and then "mig -a" on old server. That's it.

    Make sure you have set the server ip variables.
     
  6. ekhwan

    ekhwan Active Member

    Joined:
    Aug 12, 2006
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    Truly you can take me as an idiot but I would be grateful if you explain the ip variable thing too. I am a total novice dear. Both my servers have different IPs altogether. The Old server would be scraped and even its IPs
     
  7. jsnape

    jsnape Well-Known Member

    Joined:
    Mar 11, 2002
    Messages:
    174
    Likes Received:
    0
    Trophy Points:
    16
    I've tried every transfer method ever posted to these forums. Haven't tried this one yet, or even read the code yet, but the cpanel move script leaves a lot to be desired.

    1.) Creates a new dns zone file which kills any subdomains pointed off server, as well as main domain if it is pointed off the server. Why not just get the existing dns zone file, update the serial and only replace the ip if it is OF the old server. It also destroys custom mx records.

    2.) Anyone using off server dns and doesn't hear of the move, continues along happy as a clam until a week or two later we shut the old server off. They then contact us irate, we tell them to change the IP on their off site dns, they do, their site is then a week or two out of date. Aside from running a whois check on every site on the server, there's no way to know if someone is using off server dns.

    3.) Corrupt databases that run on the old server don't get packed up. We hear about it when the customers databse is not there on the new server. Well, the database NAME is there, just nothing in it. cPanel - should run a quick repair/optimize on the database befor packing it up.

    I've tried every method posted in these forums and they've all had some level of total disaster. We moved 25 servers last fall, every server move had some different bug surface in the move, some worse than others. Ended up losing about 100 customers or almost 10% of them all.

    Long whine finished.

    Does this script address any of those dns problems?
     
  8. beehave

    beehave Well-Known Member

    Joined:
    Jun 26, 2005
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    16
    Look at the fourth line of the script. Edit the line with the ip of the other server. Do this on both servers.
     
  9. beehave

    beehave Well-Known Member

    Joined:
    Jun 26, 2005
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    16
    It's posts like this that helps create great scripts!

    1) What if the script took a copy of the zone file, changed only the main ip, sent account to new server, installed account and THEN replaced zone file with one created on old server?

    2) I am open to ideas on this one.

    3) Anyone know how a script would run a repair on each database?

    Thanks!
     
  10. beehave

    beehave Well-Known Member

    Joined:
    Jun 26, 2005
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    16
    I just figured number two out. Working on it now...
     
  11. ffeingol

    ffeingol Well-Known Member
    PartnerNOC

    Joined:
    Nov 9, 2001
    Messages:
    215
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    DataCenter Provider
    How about mysqlcheck -uroot -pXXXX -A -r

    Frank
     
  12. beehave

    beehave Well-Known Member

    Joined:
    Jun 26, 2005
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    16
    This will repair all databases?
     
  13. ffeingol

    ffeingol Well-Known Member
    PartnerNOC

    Joined:
    Nov 9, 2001
    Messages:
    215
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    DataCenter Provider
    Just run mysqlcheck --help and you'll see all the options. -A is all databases and -r is repair. Note: if you have a lot or large databases this can take a long time.

    Frank
     
  14. ekhwan

    ekhwan Active Member

    Joined:
    Aug 12, 2006
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    I get an error saying -bash: /usr/bin/mig: Permission denied
    on new server please help.

    does it have anything to do with ssh keys?

    I have generated SSH keys on both servers viz WHM and added the public keys of both in the WHM as well.
     
  15. beehave

    beehave Well-Known Member

    Joined:
    Jun 26, 2005
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    16
    Looks like you may have missed a step. Run the following command and try again:

    chmod 755 /etc/mig/mig
     
  16. ekhwan

    ekhwan Active Member

    Joined:
    Aug 12, 2006
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    Thanks so much it worked.

    But now the new server is still on with the hello......
    while the old server gave an error saying no response from remote server.....existing...
     
  17. beehave

    beehave Well-Known Member

    Joined:
    Jun 26, 2005
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    16
    Did you start script on new server first? Did you install key on BOTH servers for each other?
     
  18. ekhwan

    ekhwan Active Member

    Joined:
    Aug 12, 2006
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
  19. beehave

    beehave Well-Known Member

    Joined:
    Jun 26, 2005
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    16
    See if you can ssh from each server to the other.

    ssh IP
     
  20. beehave

    beehave Well-Known Member

    Joined:
    Jun 26, 2005
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    16
    3.1 now available!

    New version now checks if user's domain is using remote dns. If so, the DNS Check will show REMOTE. DNS Check is part of the report generated after script is done.

    Script now also repares each user's databases one-at-a-time before processing each account.
     
    #20 beehave, May 17, 2007
    Last edited: May 18, 2007

Share This Page