Version 3.4.20

Released: November 11, 2020

Changes

Code style

As part of the continuous effort to keep the code maintainable and to comply with MERC 0005 (https://docs.mayan-edms.com/mercs/0005-explicit-arguments.html) keyword arguments were added to the .acquire_lock() function, uses of the library shutil, as well as uses of Command class from the sh library.

Documentation

A chapter devoted to the search system was added. Minor formatting error in the REST API chapter were fixed.

User interface

Two commits from the version 4.0 development branch were merged back. The first, makes sure that only one CSRF token is generated per form. There are no functional changes and this only concern the sources app form.

The second commit fixes an edge case where URLs with a query string were being incorrectly modified when a form was submitted in such a way it caused a reload, as is the case when a required field was left empty.

Upgrading process

Upgrading from Mayan EDMS 3.2.x or earlier

  1. Stop supervisord:

    sudo systemctl stop supervisor
    
  2. Update the Redis configuration:

    Configure Redis to discard data when it runs out of memory, not save its database, and only keep 2 database:

    echo "maxmemory-policy allkeys-lru" | sudo tee -a /etc/redis/redis.conf
    echo "save \"\"" | sudo tee -a /etc/redis/redis.conf
    echo "databases 2" | sudo tee -a /etc/redis/redis.conf
    echo "requirepass mayanredispassword" | sudo tee -a /etc/redis/redis.conf
    sudo systemctl restart redis
    
  3. Install the Python 3 development OS package:

    sudo apt-get install python3-dev
    
  4. Update the virtualenv to use Python 3:

    sudo -u mayan virtualenv --clear /opt/mayan-edms -p /usr/bin/python3
    
  5. Create a home directory for the Mayan EDMS system user:

    mkdir /home/mayan
    
  6. Grant ownership to the Mayan EDMS system user:

    chown mayan:mayan /home/mayan
    
  7. Reinstall the Python client for PostgreSQL and Redis:

    sudo -u mayan /opt/mayan-edms/bin/pip install psycopg2==2.8.6 redis==3.5.3
    

    Note

    Platforms with the ARM CPU might also need additional requirements:

    sudo -u mayan /opt/mayan-edms/bin/pip install psutil==5.7.0
    
  8. Reinstall the Python client for RabbitMQ if you are using RabbitMQ as a broker:

    sudo -u mayan /opt/mayan-edms/bin/pip install amqp==2.5.2
    

Upgrading from Mayan EDMS 3.4.x or 3.3.x

  1. Stop supervisord:

    sudo systemctl stop supervisor
    
  2. Upgrade to the latest pip version:

    sudo -u mayan /opt/mayan-edms/bin/pip install -U pip
    
  3. Update the Redis configuration to enable password protection:

    echo "requirepass mayanredispassword" | sudo tee -a /etc/redis/redis.conf
    sudo systemctl restart redis
    
  4. Remove deprecated requirements:

    sudo -u mayan curl https://gitlab.com/mayan-edms/mayan-edms/raw/master/removals.txt -o /tmp/removals.txt \
    && sudo -u mayan /opt/mayan-edms/bin/pip uninstall -y -r /tmp/removals.txt
    
  5. Update the Mayan EDMS Python package:

    sudo -u mayan /opt/mayan-edms/bin/pip install mayan-edms==3.4.20
    

    the requirements will also be updated automatically.

  6. Make a backup of your supervisord file:

    sudo cp /etc/supervisor/conf.d/mayan.conf /etc/supervisor/conf.d/mayan.conf.bck
    
  7. Update the supervisord configuration file. Replace the environment variables values show here with your respective settings. This step will refresh the supervisord configuration file with the new queues and the latest recommended layout:

    sudo -u mayan MAYAN_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=mayan \
    MAYAN_DATABASE_PASSWORD=mayanuserpass MAYAN_DATABASE_USER=mayan \
    MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
    /opt/mayan-edms/bin/mayan-edms.py platformtemplate supervisord | sudo sh -c "cat > /etc/supervisor/conf.d/mayan.conf"
    

    or:

    sudo -u mayan MAYAN_DATABASES=\"{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'127.0.0.1'}}\" \
    MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
    /opt/mayan-edms/bin/mayan-edms.py platformtemplate supervisord | sudo sh -c "cat > /etc/supervisor/conf.d/mayan.conf"
    
  8. Edit the supervisord configuration file and update any setting specific to your installation:

    sudo vi /etc/supervisor/conf.d/mayan.conf
    
  9. Migrate existing database schema and static media files with:

    sudo -u mayan MAYAN_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=mayan \
    MAYAN_DATABASE_PASSWORD=mayanuserpass MAYAN_DATABASE_USER=mayan \
    MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
    /opt/mayan-edms/bin/mayan-edms.py performupgrade
    

    or:

     sudo -u mayan MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'127.0.0.1'}}" \
     MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
    /opt/mayan-edms/bin/mayan-edms.py performupgrade
    
  10. Start supervisord:

    sudo systemctl start supervisor
    
  11. Clear the browser cache to avoid loading old web assets.

The upgrade procedure is now complete.

Backward incompatible changes

  • None

Issues closed