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

kabatak

Well-Known Member
Jun 10, 2009
148
8
68
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.
 

kabatak

Well-Known Member
Jun 10, 2009
148
8
68
Re: How to automate mirroring of entire WHM accounts to a geo-separated ser

Any ideas on this? Thanks
 

Infopro

Well-Known Member
May 20, 2003
17,090
518
613
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.
 

kabatak

Well-Known Member
Jun 10, 2009
148
8
68
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.
 

Infopro

Well-Known Member
May 20, 2003
17,090
518
613
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.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator

kabatak

Well-Known Member
Jun 10, 2009
148
8
68
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.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
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.
 

kabatak

Well-Known Member
Jun 10, 2009
148
8
68
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?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
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.
 

kabatak

Well-Known Member
Jun 10, 2009
148
8
68
Re: How to automate mirroring of entire WHM accounts to a geo-separated ser

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