'How to keep local server and cloud server sync?

I'm developing cloud-based ERP software and my client wants to have a feature where if the internet is down and the cloud is not accessible then a local server can be used to provide the service and once the internet is back cloud can sync with the updates.

Please advise. how to design such model. Software language: core PHP



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source