There is open source software called SymmetricDS that might be able to help. It performs asynchronous database replication over a slow or intermittent connnection, and it can be configured to detect and resolve conflicts with multi-master replication. It works with all the same database platforms supported by Moodle. There is also a commercial version with support called SymmetricDS Pro that includes a web interface to simplify setup and administration.
To mirror the moodledata files, you could use a tool like rsync, which is included on most Unix platforms. SymmetricDS does not sync files yet, but people have successfully written plug-ins to sync files before. I don't think you'd want to sync all the moodledata folders, since some are probably specific to the server, like cache, temp, and sessions, for example.