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.

Copy an account from another server clarification

Discussion in 'E-mail Discussions' started by niallone, Jun 19, 2011.

  1. niallone

    niallone Member

    Joined:
    May 29, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    I'm after some information about Account Transfers

    On this page:

    Main >> Transfers >> Copy an account from another server

    There is a checkbox:

    Use Incremental Backups speed-up:

    I cannot see any information about the checkbox in the documentation on this page:

    Copy an Account from Another Server


    What does this checkbox do, and how does it work - does it analyse the contents of the filesystems and databases at each end and only transfer the differences?
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    It will use already existing incremental daily backups on the remote machine and use those for the transfer rather than packaging the entire account from scratch. This will only work if such backups already exist on the remote machine.

    Of note, I gleaned details from internal case #41897 where this option was implemented to obtain this information.
     
  3. niallone

    niallone Member

    Joined:
    May 29, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    So a way I could setup a cpanel daily mirrored server would be to have the primary server run incremental backups and have the mirror server transfer the accounts with this checkbox checked?

    I'm trying to work out a way to run a mirror server that does daily mirroring of the primary server without having to transfer the entire filesystems each day, as bandwidth is very expensive for me.

    This seemed like a very simple way to go(rather then having to setup rsync & mysql exports/imports) - to setup a cron to run a script that had api hooks to transfer the accounts over once a day.
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The issue with using this method is that transferring typically requires the accounts do not already exist, so I'm not certain how you would transfer them daily when they will already exist on the mirrored machine.

    Rsyncing normally only copies file changes and would be easier to do over using this method. I'm a big fan of using rsyncs for changed data for mirroring purposes.
     
  5. niallone

    niallone Member

    Joined:
    May 29, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    I see.

    If I rsync'd the /home/* dir and created hosting accounts on the primary server, would they automatically be created on the mirror?

    Or would a better idea be to rsync the entire server?
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You cannot rsync the entire machine, since it will overwrite some of the necessary files for another machine to operate. This includes the IP addresses for the other machine as well as processes in /proc. You would basically end up destroying the server by copying everything.

    If you simply want to mirror the cPanel portions of the machine, here is a discussion on an rsync method that can be used:

    http://forums.cpanel.net/f5/rsync-backups-160054.html#post671150

    After doing the first rsync, you would want to ensure to run at least 2 more rsyncs to ensure the right users and ownership did actually copy over. Normally, the first rsync might have differing ownership or permissions due to the fact that the users don't yet exist (unless you want to copy over /etc/passwd, /etc/shadow and /etc/group over first for the rsync).
     
  7. niallone

    niallone Member

    Joined:
    May 29, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    What about MySQL copying - is it fine to do an --all databases dump, or do I have to do only the accounts on the server?

    +--------------------+
    | Database |
    +--------------------+
    | information_schema |
    | cphulkd |
    | eximstats |
    | horde |
    | leechprotect |
    | modsec |
    | mysql |
    | useraccount1 |
    | roundcube |
    +--------------------+

    i.e. - Do I need to copy all all of the above databases, or just the user account one?
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You could just take a dump of all the databases, since you are trying to mirror the machine.
     
  9. niallone

    niallone Member

    Joined:
    May 29, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    I have just sync'd a with --all-databases from an older mysql server to a newer one 5.0 > 5.1... Is that OK? Will I run into any problems with performance or efficiency etc?

    from:

    +------------+----------+-------------------------------------------------------
    | Engine | Support | Comment
    +------------+----------+-------------------------------------------------------
    | MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance
    | MEMORY | YES | Hash based, stored in memory, useful for temporary tab
    | InnoDB | DISABLED | Supports transactions, row-level locking, and foreign
    | BerkeleyDB | NO | Supports transactions and page-level locking
    | BLACKHOLE | YES | /dev/null storage engine (anything you write to it dis
    | EXAMPLE | YES | Example storage engine
    | ARCHIVE | YES | Archive storage engine
    | CSV | YES | CSV storage engine
    | ndbcluster | NO | Clustered, fault-tolerant, memory-based tables
    | FEDERATED | YES | Federated MySQL storage engine
    | MRG_MYISAM | YES | Collection of identical MyISAM tables
    | ISAM | NO | Obsolete storage engine
    +------------+----------+-------------------------------------------------------


    to:

    +------------+---------+--------------------------------------------------------
    | Engine | Support | Comment
    +------------+---------+--------------------------------------------------------
    | InnoDB | YES | Supports transactions, row-level locking, and foreign k
    | MRG_MYISAM | YES | Collection of identical MyISAM tables
    | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disa
    | CSV | YES | CSV storage engine
    | MEMORY | YES | Hash based, stored in memory, useful for temporary tabl
    | FEDERATED | NO | Federated MySQL storage engine
    | ARCHIVE | YES | Archive storage engine
    | MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance
    +------------+---------+--------------------------------------------------------
     
  10. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If the point is to mirror the two machines, then I would not suggest doing that. You would want to match the settings for Apache, PHP, MySQL and so on.
     
  11. niallone

    niallone Member

    Joined:
    May 29, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Yes, the two servers I am mirroring are exactly the same, but I wanted to copy over the accounts from another server I have and I did an --all-databases, and I'm worried now that I have stuffed the database as I now realise that i have copied over every database on that older server and have copied them from a mysiam to innodb? Do I need to rebuild MySQL on the newer server or should it be ok?
     
  12. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If you are mirroring one machine to another, you should not be putting data from another second machine onto the mirror. I suggest moving /var/lib/mysql, reinstalling MySQL using "/scripts/mysqlup --force" and then only copying the data from the machine you are mirroring.

    I cannot provide recommendations on putting data from two machines onto one mirrored server, since that would not make such a machine a mirror but a backup machine for multiple servers. If that is the purpose of the machine now, then that would have changed my prior replies on what to do. I would have likely told you not to copy the internal cPanel databases such as horde and roundcube were I to have had that knowledge previously.
     
Loading...

Share This Page