Before updating MONARC it is advised to configure database backup.
For that you need to create a file data/backup/credentialsmysql.cnf
:
[client]
host = localhost
user = sql-monarc-user
password = your-password
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = sql-monarc-user
password = your-password
socket = /var/run/mysqld/mysqld.sock
basedir = /usr
If this file is not present, a warning message will be displayed during the update.
Keep the software of your distribution up-to-date (Apache, PHP, MariaDB, Postfix, etc.). At least the security updates from the GNU/Linux distribution.
If you have already installed MONARC and want to update to a later version, you can use the provided script:
$ ./scripts/update-all.sh -c
$ rm -Rf ./data/cache
$ sudo systemctl restart apache2.service
Updates from the last stable release of MONARC will be retrieved.
For more details the script will:
-
backup your databases in case the update fails (if enabled, as explained previously);
-
check the presence of composer and if needed install it;
-
retrieve the new code from the last stable release (master branch):
-
pull updates for module/[MonarcCore, MonarcBO/MonarcFO] via composer;
-
pull updates for node_modules/[ng_anr, ng_backoffice/ng_client].
-
-
run the appropriate database upgrade scripts;
-
update the translations.
Please be aware that by default the update script will run database migrations
This behavior can be changed by passing the -b
option to the update script.
When MONARC is connected to a back office and has been deployed with the ansible playbook, three steps are required for a full proper update.
-
Update of the back office
-
Update of MONARC
-
Update of the configuration server (ansible playbook)
Always use the ansible user.
$ su ansible
$ cd /var/lib/monarc/bo/MonarcAppBO/
$ ./scripts/update-all.sh
$ sudo systemctl restart apache2.service
$ su ansible
$ cd /var/lib/monarc/fo
$ ./scripts/update-all.sh -b
$ sudo systemctl restart apache2.service
$ su ansible
$ cd /home/ansible/ansible-ubuntu/
$ git pull origin master
If you have any problem you can check the section dedicated to the common issues.