Ken Robinson's picture

Have TKL Mayan EDMS v17.1 and want to upgrade? In this post I will document how you can upgrade Mayan EDMS v17.1 v4.2.7 to the latest (as of this post) to v4.3.4 in about 30 minutes or less! If you find this helpful or have questions or issues post a reply.

Note: The warnings about urllib3, chardet and charset_normalizer are normal and are cause by the transition between Python 3.9 and 3.10 taking place for some dependencies. 


This guide assumes:

  • You are logged in as root
  • You have a working system
  • You have not made any modifications to the base system
  • Made a complete backup of your system

Now lets crack on shall we? This is very much like my other post "TKL Mayan EDMS v16.1 - Upgrade v3.5.5 to 4.0.23" where I basically take instructions from the docs but tweak them for TKL install.

Mayan EDMS 4.3.4 Release Notes


# Turnkey Mayan V17.1
# EDMS Upgrade from 4.2.7 to 4.3.4

# Create home dir
# Pip will be angry if there is no home dir, cache will be disabled
# Also su gets angry when the home dir is missing in later steps and
# will fail.
# Skip this if the home dir is there
mkdir /home/mayan
chown mayan:mayan /home/mayan

# (1.) Stop Services 
systemctl stop supervisor

# (2.) Backup supervisor config
mv /etc/supervisor/conf.d/mayan.conf /etc/supervisor/conf.d/mayan.conf.backup

# (3.) Backup db
pg_dump mayan > ~/mayan_db_backup.sql

# (4.) Upgrade PIP
su - mayan -c "/opt/mayan-edms/bin/pip install --upgrade pip"

# (5.) Remove un-needed packages 
su - mayan -c "curl -o /tmp/removals.txt"
su - mayan -c "/opt/mayan-edms/bin/pip uninstall --yes --requirement /tmp/removals.txt"

# (6.) Update Mayan
su - mayan -c "/opt/mayan-edms/bin/pip install mayan-edms==4.3.4"

# (7.) Update the environment file
# as we only need one line now all settings are in the config file in the media folder
mv /etc/mayan/env /etc/mayan/env.backup
echo "export MAYAN_MEDIA_ROOT=/opt/mayan-edms/media" > /etc/mayan/env

# (8.) Setup the environment for the next few steps 

# (9.) Update Supervisor config
# You may get some errors at top, but as long as the file gets updated
su - mayan -c ". $ENV && $BIN/ platformtemplate supervisord" > /etc/supervisor/conf.d/mayan.conf

# (11.) Edit the supervisord configuration file and update any setting 
# specific to your installation and verify its been created
nano /etc/supervisor/conf.d/mayan.conf

# (12.) Upgrade db
su - mayan -c ". $ENV && $BIN/ performupgrade"

# (13.) Start supervisor, check status
systemctl start supervisor
supervisorctl status

# (14.) Clear the browser cache, and check app functions

# (15.) Cleanup backup files
rm /etc/mayan/env.backup
rm ~/mayan_db_backup.sql
rm /etc/supervisor/conf.d/mayan.conf.backup


Jeremy Davis's picture

Thanks so much Ken, love your work mate! :)

Add new comment