Skip to content

Latest commit

 

History

History
202 lines (135 loc) · 5.84 KB

linshare-upgrade-from-v4.1-to-v4.2.md

File metadata and controls

202 lines (135 loc) · 5.84 KB

LinShare upgrade guide

Note :

  • We explain in this file how to upgrade your LinShare's version.
  • Please note that all the components found in each LinShare's version (http://download.linshare.org/versions/{VERSION}) must be upgraded together.
    Each LinShare version folder, contains the dependencies required to install the version properly.
  • You can find the required versions of LinShare's dependencies here

Overview

LinShare versions number are named according to the following pattern

X.Y.Z.

  • X : Major release A major version can bring disruptive changes, among which addition/replacement/removal of technologies used in the product. They could break compatibility between two versions of LinShare.

  • Y : Minor release A minor version brings new functionalities and possibly database schema modification.

  • Z : Maintenance release Only bug fixes. No database schema modification.

For this migration, download the following files from this address: http://download.linshare.org/versions/4.2.0 :

  • linshare-core-4.2.0.war

  • linshare-core-4.2.0-sql.tar.bz2

  • linshare-ui-admin-4.2.0.tar.bz2

  • linshare-ui-user-4.2.0.tar.bz2

  • linshare-ui-upload-request-4.2.0.tar.bz2

Note :

  • In this upgrade guide we suppose that all components are downloaded on /root/downloads directory

To avoid any side effect of these critical operations, it is better to store a backup of your databases PostgreSQL and MongoDB.

Note :
In this upgrade guide we consider that the default databases PostgreSQL and MongoDB are named linshare

To do that please execute these commands :

  • Postgres linshare dump:
       pg_dump -h `host` -p `port` -U linshare -W  -f dump-linshare.sql
  • MongoDb linshare dump:

For mongo you can just dump linshare database and avoid dumping linshare-files because it contains only thumbnail and mail attachments, it won't be impacted by the upgrade process.

         mongodump --host `host` --port `port` --db=linshare

First you need to stop Apache and Tomcat services:

$ systemctl stop apache2
$ systemctl stop tomcat9.service

Once your Tomcat service is stopped, you should extract the content of linshare-core-4.2.0-sql.tar.bz2 by using this command:

$ tar xjvf  /root/downloads/linshare-core-4.2.0-sql.tar.bz2

Then you will find the required file for the migration, named linshare-core-4.1.0-sql/postgresql/Migration_4.1.0_to_4.2.0.sql

In order to upgrade LinShare from 4.1 to 4.2 you need to run the migration script as follow:

$ psql -h `host` -d linshare -U linshare -f Migration_4.1.0_to_4.2.0.sql

Once the migration script is done, you can check the database's version through the following query: select * from version.

The next step, you should replace the linShare.war with LinShare-core-4.2.0.war:

$ rm /var/lib/tomcat9/webapps/linshare.war
$ rm -fr /var/lib/tomcat9/webapps/linshare
$ cp  /root/downloads/linshare-core-4.2.0.war /var/lib/tomcat9/webapps/linshare.war
$ systemctl start tomcat9.service

Deploy the archive of the application LinShare UI Admin in the Apache2 repository :

$ cd /var/www/
$ rm -rf linshare-ui-admin
$ tar xjvf /root/downloads/linshare-ui-admin-4.2.0.tar.bz2
$ chown -R www-data: /var/www/linshare-ui-admin

Deploy the archive of the application LinShare UI User in the Apache2 repository :

$ cd /var/www/
$ rm -rf linshare-ui-user
$ tar xjvf  /root/downloads/linshare-ui-user-4.2.0.tar.bz2
$ chown -R www-data: /var/www/linshare-ui-user

Deploy the archive of the application LinShare UI Upload Request in the Apache2 repository :

$ cd /var/www/
$ rm -rf linShare-ui-upload-request
$ tar xjvf  /root/downloads/linshare-ui-upload-request-4.2.0.tar.bz2
$ chown -R www-data: /var/www/linShare-ui-upload-request

Now you can start your Apache service again.

$ systemctl apache2 start

For this new version, you need to run further upgrade tasks in the admin interface : http://YourServerName/#/upgradetasks/list.

All the tasks must be executed by order and succeed in order to complete the upgrade.

NB: A task can finish with a successful status but errors can be noticed during the progress. It is necessary to check the execution reports found in the console. In case of errors, you must read the logs of Tomcat server for more details, resolve the problems and re-launch the task.

  • As long as the tasks with status Mandatory are not completed, the users can not use the system.

  • As long as the tasks with status Required are not completed, the system will work partially (Some functionalities might be deactivated). These tasks can be executed simultaneously without disrupting the user's activity.

Once the mandatory tasks have been executed, you can switch to the next step if you want to re-establish quickly the LinShare service. The required tasks can take some time depending on amount of data to upgrade.

Once all these tasks are done, your LinShare will be operational.