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.

How to automate mirroring of entire WHM accounts to a geo-separated server?

Discussion in 'General Discussion' started by kabatak, Apr 10, 2012.

  1. kabatak

    kabatak Well-Known Member

    Joined:
    Jun 10, 2009
    Messages:
    80
    Likes Received:
    1
    Trophy Points:
    8
    Hello,

    Currently I am looking for a solution to mirror a primary VPS to a backup VPS (on different data center). Both having WHM. Here's what I am looking to achieve:

    • Each Cpanel accounts' public_html folder from Primary VPS will be mirrored once a day to Backup VPS
    • Each Cpanel accounts' MySQL DBs from Primary VPS will be exported then imported to Backup VPS once a day
    • All email and MX Records will remain at Primary VPS, no need to mirror (to prevent possible conflicts of messages)

    Currently, I can achieve this manually but can you recommend a way to automate this process so that it runs at least once a day? Thanks.
     
  2. kabatak

    kabatak Well-Known Member

    Joined:
    Jun 10, 2009
    Messages:
    80
    Likes Received:
    1
    Trophy Points:
    8
    Re: How to automate mirroring of entire WHM accounts to a geo-separated ser

    Any ideas on this? Thanks
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Re: How to automate mirroring of entire WHM accounts to a geo-separated ser

    AFAIK, there is no perfect way to do what you want. You might try searching for the word mirror on the forums here for more comments and ideas on this if you're interested.

    Sending your backups to another server for safe keeping is a good thing to do. You can do this via Backup settings in WHM. But these will be compressed backups. Those backups can be used for disaster recovery of course.
     
  4. kabatak

    kabatak Well-Known Member

    Joined:
    Jun 10, 2009
    Messages:
    80
    Likes Received:
    1
    Trophy Points:
    8
    Re: How to automate mirroring of entire WHM accounts to a geo-separated ser

    I see. I saw some options in WHM:

    Copy multiple accounts/packages from another server and the usual Backup/Restore

    Are there any significant difference between them aside from the latter probably being used for "archiving" backups?
    I believe the former is what I'm probably looking for, just need to automate it.
     
  5. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Re: How to automate mirroring of entire WHM accounts to a geo-separated ser

    Copy multiple accounts/packages from another server tools are for moving from one server to another, you are correct. But this is used for moving [and] restoring them to the new server you move them to.
     
  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
  7. JayFromEpic

    JayFromEpic Well-Known Member

    Joined:
    Apr 2, 2011
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Scottsdale, AZ
    cPanel Access Level:
    Root Administrator
    Re: How to automate mirroring of entire WHM accounts to a geo-separated ser

    Tristan, you beat me to it. I recently used lsyncd as well for a similar purpose.
     
  8. kabatak

    kabatak Well-Known Member

    Joined:
    Jun 10, 2009
    Messages:
    80
    Likes Received:
    1
    Trophy Points:
    8
    Re: How to automate mirroring of entire WHM accounts to a geo-separated ser

    Thanks I'll check on lsyncd. From the looks of it, it seems like it's suited for web files only. I'm not sure if it safe to use to mirror in MySQL transactional tables.
     
  9. 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
    Re: How to automate mirroring of entire WHM accounts to a geo-separated ser

    I wouldn't depend on InnoDB-based directories being copied that way only. You'd want to make periodic mysqldump backups of that data as well and sync that directory containing the mysqldump files.
     
  10. kabatak

    kabatak Well-Known Member

    Joined:
    Jun 10, 2009
    Messages:
    80
    Likes Received:
    1
    Trophy Points:
    8
    Re: How to automate mirroring of entire WHM accounts to a geo-separated ser

    @cPanelTristan - Ok, so you mean I don't necessarily need to restore the mysqldumps every time on the other server but just in case the mirroring of db files went wrong then I have a better copy from mysqldump?
     
  11. 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
    Re: How to automate mirroring of entire WHM accounts to a geo-separated ser

    Correct, you don't necessarily need to use them unless the files end up corrupted for InnoDB. At that point, you'll have the mysqldump files to use.
     
  12. kabatak

    kabatak Well-Known Member

    Joined:
    Jun 10, 2009
    Messages:
    80
    Likes Received:
    1
    Trophy Points:
    8
    Re: How to automate mirroring of entire WHM accounts to a geo-separated ser

    Alright, that seems to be the best practice. Thank you.
     
Loading...

Share This Page