You are here
Edit: Updated to 4.4.4 - Also note support from the developer.
Edit: This only works with v17.1. If you have an older version (v16) check out these posts: TKL Mayan EDMS v16.1 - Upgrade v3.5.5 to 4.0.23 and Migration of TKL Mayan EDMS v16.1 to 17.1
Please note that the developer of Mayan NO LONGER SUPPORTS A MANUAL INSTALL. Hint we use a manual install for Turnkey. It seems he started removing upgrade instructions after 4.4. However with that being said, these instructions do work! If you run into issues post here first!
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.
Have a Fresh TKL Mayan EDMS v17.1 install 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.4.4 in about 30 minutes or less! If you find this helpful or have questions or issues post a reply.
Note: There are changes in v4.4.2 that are not backwards compatible. Please read the release notes to see what those changes are!
This guide assumes:
- You are using TKL Mayan EDMS v17.1
- 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 once again 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.4.4 Release Notes
# Turnkey Mayan V17.1 # EDMS Upgrade from 4.2.7 to 4.4.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 https://gitlab.com/mayan-edms/mayan-edms/-/raw/v4.4.4/removals.txt -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.4.4" # (7.) Update the environment file # as we only need one line now all settings are in the config file in the media folder # Skip this step if you already did this # 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 # ENV=/etc/mayan/env BIN=/opt/mayan-edms/bin # (9.) Update Supervisor config # You may get some errors at top, but as long as the file gets updated su - mayan -c ". $ENV && $BIN/mayan-edms.py platform_template 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/mayan-edms.py common_perform_upgrade" # (13.) Start supervisor, check status systemctl start supervisor supervisorctl status # (14.) Clear the browser cache, and check app functions # # (15.) Cleanup backup files # Only clear the files if everything is working! # rm /etc/mayan/env.backup rm ~/mayan_db_backup.sql rm /etc/supervisor/conf.d/mayan.conf.backup
Updated for v4.4.4
Updated to upgrade to v4.4.4
Regards,
Ken
":0)
http://www.github.com/DocCyblade
Thanks Ken! :)
Thanks Ken! :)
Great guide!
Upgrading Python from 3.7 to 3.9 to install 4.4.4 upgrading
Best way to upgrade to Python3.9
The best way to upgrade to Python3.9 is to move to a newer Debian version. I assume you have a v16.x appliance (based on Debian 10/Buster) - so you'll want to move to v17.x (based on Debian 11/Bullseye - which includes Python 3.9 by default).
one way is to launch a new v17.x appliance and then migrate your data across to it. Alternatively, you can do an "in place" Debian upgrade - to upgrade the base OS from Debian 10/Buster to Debian 11/Bullseye. Technically we don't support the latter option, but it should work fine and I'm happy to give you free "best effort" support if you wish to go that way. It's also worth noting that a Debian in-place upgrade won't get you TurnKey v17.x, it will be a hybrid of v16.x, but with a newer Debian Bullseye base.
Either way, if you want some support, please sign up to a free website user account and to ensure that I enable it in a timely manner, please shoot me an email to support AT turnkeylinux.org.
Some resources that are worth a read:
What version of TKL Mayan
What version of TKL Mayan EDMS are you running, and what version of Mayan is running it seems it may be v16 like J is assuming.
I updated the post with assumptions that include running v17.1 Mayan to make it more clear.
If you have an older version (v16) check out these posts: TKL Mayan EDMS v16.1 - Upgrade v3.5.5 to 4.0.23 and Migration of TKL Mayan EDMS v16.1 to 17.1
Regards,
Ken
":0)
http://www.github.com/DocCyblade
LDAP
Do you think you can help me figure out after updating to 3.9 I can't get LDAP to work, can you look at this code and let me know if I need to change anything, I'm using ldap3, python-ldap
from __future__ import absolute_import
from mayan.settings.production import *
import ldap
from django_auth_ldap.config import (
LDAPSearch, LDAPSearchUnion, NestedActiveDirectoryGroupType
)
from django.contrib.auth import get_user_model
SECRET_KEY = 'SecretKey'
# makes sure this works in Active Directory
ldap.set_option(ldap.OPT_REFERRALS, 0)
# Turn of debug output, turn this off when everything is working as expected
ldap.set_option(ldap.OPT_DEBUG_LEVEL, 4095)
# This is the default, but I like to be explicit.
AUTH_LDAP_ALWAYS_UPDATE_USER = True
LDAP_USER_AUTO_CREATION = "False"
LDAP_URL = "ldap://:389/"
LDAP_BASE_DN = "DC=usit,DC=com"
LDAP_ADMIN_DN = "CN=,OU=,DC=usit,DC=com"
LDAP_PASSWORD = ""
AUTH_LDAP_SERVER_URI = LDAP_URL
AUTH_LDAP_BIND_DN = LDAP_ADMIN_DN
AUTH_LDAP_BIND_PASSWORD = LDAP_PASSWORD
AUTH_LDAP_USER_SEARCH = LDAPSearchUnion(
LDAPSearch(
'OU=WebDevelopment,DC=USIT,DC=com',
ldap.SCOPE_SUBTREE,'(samaccountname=%(user)s)'
),
LDAPSearch(
'OU=Information Technology,DC=USIT,DC=com',
ldap.SCOPE_SUBTREE,'(samaccountname=%(user)s)'
),
LDAPSearch(
'OU=Service Accounts,DC=USIT,DC=com',
ldap.SCOPE_SUBTREE,'(samaccountname=%(user)s)'
),
LDAPSearch(
'OU=Environmental,DC=USIT,DC=com',
ldap.SCOPE_SUBTREE,'(samaccountname=%(user)s)'
),
LDAPSearch(
'OU=Fish & Wildlife,DC=USIT,DC=com',
ldap.SCOPE_SUBTREE,'(samaccountname=%(user)s)'
),
LDAPSearch(
'OU=Law,DC=USIT,DC=com',
ldap.SCOPE_SUBTREE,'(samaccountname=%(user)s)'
),
)
AUTH_LDAP_USER_ATTR_MAP = {
'first_name': 'givenName',
'last_name': 'sn',
'email': 'mail'
}
AUTHENTICATION_BACKENDS = (
'django_auth_ldap.backend.LDAPBackend',
'mayan.media.mayan_settings.ldaplogin.EmailOrUsernameModelBackend',
)
class EmailOrUsernameModelBackend(object):
"""
This is a ModelBackend that allows authentication with either a username or an email.
"""
def authenticate(self, request, username=None, password=None, **kwargs):
if '@' in username:
kwargs = {'email': username}
else:
kwargs = {'username': username}
try:
user = get_user_model().objects.get(**kwargs)
if user.check_password(password):
return user
except get_user_model().DoesNotExist:
return None
def get_user(self, user_id):
try:
return get_user_model().objects.get(pk=user_id)
except get_user_model().DoesNotExist:
return None
Update / Migration
Hello, Thank you for the help, I ended up deploying a new Debian and moving all the files over thanks to Kens instructions, however, after moving - i cant get LDAP to work again any insight on that ?
LDAP Link
So i forgot to mention that the LDAP link im using is
Im thinking that there is something wrong with it, when I change that from production to the location of my LDAP file I get an error other than that Production works fine.
thank you
Hi Morkg - Unfortunately, I'm not sure...
Apologies on the really slow response (I've got my head down working on the next major release).
TBH, LDAP is not my strong suit, so I'm possibly not much help to you. I suggest that you reach out to the Mayan community and ask them for assistance. If you do post over there, it might be good to cross post a link here, to the thread you start over there.
Add new comment