Update MiaRec Web portal

Use these instructions only if MiaRec has been installed manually. For Ansible-based deployment, use the update instructions from here.

1. Download latest MiaRec web-portal files

Fill out Download form to get access to latest version of MiaRec.

wget URL_TO_MIARECWEB_FILES

Extract this archive

tar -xzvf miarecweb-*.tar.gz

2. Rename old MiaRec Web application files

It is recommended to rename the existing MiaRec web portal folder instead of removing it. This will allow you to restore old version if necessary.

mv /var/www/miarec/app /var/www/miarec/app-`date +"%m-%d-%Y"`

3. Install new version of MiaRec Web application

Move the extracted new files to /var/www/miarec/app

mv miarecweb-*/ /var/www/miarec/app

Clear cache (pre-compiled templates):

rm -rf /var/www/miarec/cache/*

4 Upgrade MiaRec database layout

Activate python virtual environment

source /var/www/miarec/pyenv/bin/activate

Make sure the development packages of libxml2 and libxslt are installed:

yum install libxml2-devel libxslt-devel

Install/update miarecweb application:

PATH=$PATH:/usr/pgsql-9.4/bin/
pip install -e /var/www/miarec/app

Run database migration script (alembic):

alembic -c /var/www/miarec/production.ini upgrade head

Tip: if execution of the database migration script takes more than 5 minutes, then probably some database tables are locked by other processes and the migration script waits till lock is released. To fix that issue, you need to stop other services, which are using MiaRec database.

Open another SSH window and execute the following commands:

service httpd stop

service celeryd stop

service celerybeat stop

5. Restart Apache and Celery services

service httpd restart

service celeryd restart

service celerybeat stop
service celerybeat start