A database cannot be backed up using Unison because its state is mostly stored in RAM and not committed to file system. As a result, it is best to use a database dump command to back up the database:
This command dumps all the databases for a full restoration on another system, and compress the file. However, this command does not store the compressed file, just dump it to stdout.
The command to do this remotely, assuming sudo is set up already, is as follows: