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.

Pre-copy files before account transfer

Discussion in 'General Discussion' started by webignition, Apr 19, 2005.

  1. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    I'll soon be moving from one server to another and thus be moving accounts from one server to another.

    One account has a moderately busy forum and a fair amount of images used with an image gallery. In order for no problems to arise with the database content during the transfer my DC recommended I suspend such accounts before transferring, which makes a lot of sense to me.

    This particular account has got about 140MB to transfer, which on the grand scale of things isn't really that much. However as the server the account is being transferred from is on a 2Mbps connection, it may take around 20-30 mins to transfer (assuming conditions won't be 100% ideal).

    As I mentioned, a good portion of this account's data are in image files. If these were not taken into account, there would be about 40MB to transfer which would obviously be a lot quicker.

    What I would like to do is to create the home directory for this account on the new server and copy the chunk of image files across before doing the account transfer. This would result in less downtime for the account and could present the option of not having to suspend the account for the duration of the transfer.

    Does anyone know if this could be done? When transferring an account if files being transferred already exist on the destination server and are newer than those on the source server, would or could they be ignored by the transfer process?

    Thanks greatly for any advice anyone can suggest - I'd prefer to get some opinions on this rather than just trying it to see what happens!
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    I believe that it would just splat the backup on top and you would be fine. However, it might be simpler and more sure, if you just transfer the backup of those files over first, but don't restore them. Then transfer the reduced account when you need to and restore it. Then restore the image files back into the users account afterwards. That will certainly work.
     
  3. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    18
    You could transfer the backup first as Chirpy mentioned, then use /scripts/restorepkg $user or the whm option to restore the account from that backup on the second server.

    I have also in the past when dealing with large accounts, transferred the /home/$user directory over to a new server first (create it as $user.new or something, then copy the data to that directory) , so all the data is there (especially handy when dealing with GB's of files) and prior to using the whm copy account, I have moved the /home/$user on the original server to /home/$user.bak , created a new /home/$user directory (may be not needed to do that but I did) and then copied the account to the new server.
    The account should be created pretty quickly on the new server and you can restore the files that you pre copied onto the account, then move the original /home/$user.bak to /home/$user ... phew.. :)

    With a large active database, I'd usually edit the MySQL connection scripts to connect to the database on the new server immediately after tansferring it, so no matter which server is serving web pages, the database is only being updated on the new server. You just need to allow the original server IP to access the db, either manually or using whm or cPanel on that account.

    Then update the dns A records to point at the new IP. Reducing TTL values to something like 600 seconds, at least 4 hours prior to the move, should see things propagate nice and quickly too, but ensuring the db is only updated on one server takes care of that issue.
    You could also add the domain to /etc/remotedomains and run /scripts/mailperm on the original server, so as to ensure correct mail routing, otherwise both servers will think they are hosting the mail locally until you remove the account from the original server.
     
Loading...

Share This Page