Owncloud synchronization between 2 servers, one as fail-over

Hi everyone,
I would like to implement something as follows:
I have primary owncloud server at home (hosted on esxi server). I would like to have some sort of backup/fail-over, if main server goes down, either it switches automatically to second server offsite or i switch it manually.
The problem is, how can I solve synchronization of data between the two servers, if I want both servers to have all the same data.
Thank you