Ken Robinson's picture

I recently needed to upgrade my Mayan EDMS. Was running TKL Mayan EDMS v16.1 (Mayan EDMS v3.5.5) I thought I would share my upgrade notes here. They are based off of the offical documentation from Mayan. 

Mayan EDMS 4.0.15 Release Notes

 

# Turnkey Mayan V16.1
# EDMS Upgrade from 3.5.5 to 4.0.15

# Create home dir (Should have done this)
mkdir /home/mayan
chown mayan:mayan /home/mayan

# (1.) Stop Services 
systemctl stop supervisor

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

# Restore Config File. For some reason there is no config file?
# Upgrade tells you to modify this file
# Only if it does not exist!
mv /opt/mayan-edms/media/config_backup.yml /opt/mayan-edms/media/config.yml

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

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

# (5.) Remove un-needed packages 
su - mayan -c "curl https://gitlab.com/mayan-edms/mayan-edms/raw/master/removals.txt -o /tmp/removals.txt"
su - mayan -c "/opt/mayan-edms/bin/pip uninstall -y -r /tmp/removals.txt"

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

# (7.) Create Custom Settings
# Only if they do not exist already
su - mayan -c "mkdir --parents /opt/mayan-edms/media/user_settings/"
su - mayan -c "touch /opt/mayan-edms/media/user_settings/__init__.py"

# (8.) Change databases to 3
# Grab your password too you needed it later!
nano /etc/redis/redis.conf 

# (9.) Update the config.yml
# Only if these has not been done already
#
# Put your password at password-goes-here
#
# Replace this
# LOCK_MANAGER_BACKEND="..."
# LOCK_MANAGER_BACKEND_ARGUMENTS="..."
#
# with
# LOCK_MANAGER_BACKEND: mayan.apps.lock_manager.backends.redis_lock.RedisLock
# LOCK_MANAGER_BACKEND_ARGUMENTS: {'redis_url':'redis://:password-goes-here@127.0.0.1:6379/2'}

nano /opt/mayan-edms/media/config.yml 

# Restart redis to take on the new Settings
systemctl restart redis.service

# (10.) Update Supervisor config
#
# Load the environment vars
ENV=/etc/mayan/env
BIN=/opt/mayan-edms/bin
su - mayan -c ". $ENV && $BIN/mayan-edms.py platformtemplate supervisord" > /etc/supervisor/conf.d/mayan.conf

# (11.) Edit the supervisord configuration file and update any setting specific to your installation:

nano /etc/supervisor/conf.d/mayan.conf

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

# (13.) Start supervisor
systemctl start supervisor

# (14.) Clear the browser cache

# If you upgraded from 3.X to 4.X you need to move your files and cache since the
# default place was changed! If you skip this step existing documents will
# not show a preview
mv /opt/mayan-edms/media/document_storage/* /opt/mayan-edms/media/document_file_storage/
mv /opt/mayan-edms/media/document_cache/* /opt/mayan-edms/media/document_file_page_image_cache/


 

 

 

 

 


 

 

Forum: 
Jeremy Davis's picture

Great notes. Thanks heaps for sharing mate! :)

Add new comment