Site Overlay

Simple backup solution for Mayan EDMS

When it comes to backing up Mayan, we essentially have to back up two components:

  1. The /opt/mayan-edms/media directory
  2. The PostgreSQL database

Remote storage location

First thing we need is a remote storage location. We go for an NFS share which we mount on the Mayan System.

Initial setup

Setup on the storage machine is the same as section 1.1 of the Raspibackup instructions.

The backup path on the destination machine is: /home/nfs/mayanha with ownership privileges for nobody:nogroup.

On the Mayan server, set up a mount point as follows:

Mounting the NFS system

In order to perform a backup, mount the remote NFS system to the mountpoint you created on the Mayan machine:

In case you get a message like the one below, your client machine lacks the nfs-common (distros other than Ubuntu may call it nfs-utils) package. Just issue sudo apt install nfs-common.

Backup Operation

To backup the PostgreSQL data base, on the Mayan Machine issue the following command:

We prefer to have the complete PostgreSQL Server dumped instead of the single Mayan data base because we don’t have to care about user privileges and passwords that way.

Next we will backup the /opt/mayan-edms/media directory as per the backup instructions of the Mayan online documentation.

We slightly deviate from the instructions given in the Mayan documentation in two points:

  1. We stop the supervisor daemon to prevent Mayan EDMS from altering the files in the media directory while the backup is running.
  2. We leave out the verbose option in the tar command as the verbose option results in an endless list of files which (a) slows down the creation of the tar.gz file and (b) prevents us from properly noticing error messages that might be relevant but gets lost in the file list.

After the backup don’t forget to reengage the supervisor service:

Open Questions

Notice that the there are other files and directories under /opt/mayan-edms/media:

This means that upon restore writing just expanding the backup of the media subdirectory will not reproduce the complete mayan installation.

It should rather be assumed that you have an ’empty’ Mayan EDMS installation installed for which you will have to overwrite the media directory with the content from your backup file.

Furthermore, looking at the upgrade instructions in the Mayan online documentation, there are additional files that (might) have to be customized:

  • /etc/supervisor/conf.d/mayan-edms.conf (this is even outside the /opt/mayan-edms/ directory), this file looks unsuspicious though and unless there have not been explicit customizations, the conf file created from an empty Mayan installation should be fine.
  • /etc/redis/redis.conf (again outside the /opt/mayan-edms/ directory), note that this file holds the redis password