Our road from Alfresco 5.1.g to Alfresco 201701

by / Thursday, 16 February 2017 / Published in Blog
Upgrading Alfresco from 201701-GA to 201702-GA
Alfresco SDK 3.0 beta 1 available

Last month, first prod version for Alfresco Community 5.2 branch was released. After last changes, this version is identified as 201701 and it includes following components:

  • 5.2.e for Alfresco Platform
  • 5.2.d for Alfresco Share

This blog post describes our upgrading process for our corporative server, where Alfresco 5.1.g using SOLR 4 was installed. Upgrading has been performed to Alfresco CE 201701 using SOLR 6.

Initial status

  • Alfresco CE 5.1.g using PostgreSQL 9.4 with Ubuntu 14.04
  • 12 GB RAM available in the server: 6 for Alfresco and the other for PostgreSQL, LibreOffice and OS
  • Repository size is 38 GB and it includes more than 100.000 documents
  • Authentication is integrated with OpenLDAP
  • Customisations are applied only by using AMP modules
$ cd /opt/alfresco/alf_data/contentstore
$ sudo du --max-depth=1 -h
3.0G    ./2013
14G     ./2014
6.4G    ./2015
14G     ./2016
866M    ./2017
38G     .

Running the process

Warning Following steps could not be the right ones for your environment, the steps are included only as reference for your own upgrading process.

Database backup

We were using installation wizard from Alfresco, so PostgreSQL software is installed under Alfresco folder. After stopping Alfresco (script also stops PostgreSQL), database is started and the dump is performed.


$ sudo service alfresco stop

$ sudo su - postgres

$ cd /opt/alfresco/postgresql/bin
$ ./pg_ctl start

$ ./pg_dump alfresco > /tmp/exportFile-20170214.dmp
Password:

$ ./pg_ctl stop
$ exit

Repository backup

Before starting, a repository backup is performed. So, while we are installing the new Alfresco, required resources (files, indexes, configuration, amps…) are available to copy.


$ mv /opt/alfresco /opt/alfresco-old

Installing LibreOffice dependencies

Alfresco 201701 includes LibreOffice 5.2.1, so new OS dependencies are required.


$ sudo apt-get install ttf-mscorefonts-installer fonts-droid libxinerama1 libglu1-mesa 

However, even after verifying that every dependency is available, Alfresco installer still complains. We are ignoring this warning, as it looks like an installer issue.

Installing new Alfresco (201701)

We are going to use again Alfresco wizard installer from 201701. As we had Alfresco running in port 9080, we are configuring 9* ports for Tomcat.


$ sudo ./alfresco-community-installer-201701-linux-x64.bin
Some or all of the libraries needed to support LibreOffice were not found on your system: fontconfig libSM libICE libXrender libXext libcups libGLU libcairo2 libgl1-mesa-glx
You are strongly advised to stop this installation and install the libraries.
For more information, see the LibreOffice documentation at http://docs.alfresco.com/search/site/all?keys=libfontconfig

Do you want to continue with the installation? [y/N]: y

Language Selection

Please select the installation language
[1] English - English
[2] French - Français
[3] Spanish - Español
[4] Italian - Italiano
[5] German - Deutsch
[6] Japanese - 日本語
[7] Dutch - Nederlands
[8] Russian - Русский
[9] Simplified Chinese - 简体中文
[10] Norwegian - Norsk bokmål
[11] Brazilian Portuguese - Português Brasileiro
Please choose an option [1] : 1
----------------------------------------------------------------------------
Welcome to the Alfresco Community Setup Wizard.

----------------------------------------------------------------------------
Installation Type

[1] Easy - Install using the default configuration.
[2] Advanced - Configure server ports and service properties.: Choose optional components to install.
Please choose an option [1] : 2

----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.

Java [Y/n] :Y

PostgreSQL [Y/n] :Y

LibreOffice [Y/n] :Y

Alfresco Community : Y (Cannot be edited)

Solr1 [y/N] : n

Solr4 [Y/n] :Y

Alfresco Office Services [Y/n] :Y

Web Quick Start [y/N] : n

Google Docs Integration [Y/n] :n

Is the selection above correct? [Y/n]: Y

----------------------------------------------------------------------------
Installation Folder

Choose a folder to install Alfresco Community.

Select a folder: [/opt/alfresco-community]: /opt/alfresco

----------------------------------------------------------------------------
Database Server Parameters

Enter the port of your database.

Database Server Port: [5432]:

----------------------------------------------------------------------------
Tomcat Port Configuration

Enter your Tomcat configuration parameters.

Web Server Domain: [127.0.0.1]:

Tomcat Server Port: [8080]: 9080

Tomcat Shutdown Port: [8005]: 9005

Tomcat SSL Port: [8443]: 9443

Tomcat AJP Port: [8009]: 9009

----------------------------------------------------------------------------
LibreOffice Server Port

Enter the port that the LibreOffice Server will listen to.

LibreOffice Server Port: [8100]:

----------------------------------------------------------------------------
FTP Port

Choose a port number for the integrated FTP server.

Port: [21]:

----------------------------------------------------------------------------
Admin Password

Specify a password for the Alfresco Content Services administrator account.

Admin Password: :
Repeat Password: :
----------------------------------------------------------------------------
Install as a service

If you register Alfresco Community as a service it will automatically start
Alfresco Community on machine startup.

Install Alfresco Community as a service? [Y/n]: y

----------------------------------------------------------------------------
Setup is now ready to begin installing Alfresco Community on your computer.

Do you want to continue? [Y/n]: Y

----------------------------------------------------------------------------
Please wait while Setup installs Alfresco Community on your computer.

Installing
0% ______________ 50% ______________ 100%
#########################################

----------------------------------------------------------------------------
Setup has finished installing Alfresco Community on your computer.

View Readme File [Y/n]: n

Launch Alfresco Community [Y/n]: n

We are using SOLR 4 by now, as installer has no SOLR 6 option. Later in this post, SOLR 4 will be replaced by SOLR 6.

Restoring previous configuration (5.1.g)

As we are installing at the same path, previous alfresco-global.properties can be copied from 5.1.g to 201701


$ sudo mv /opt/alfresco/tomcat/shared/classes/alfresco-global.properties /opt/alfresco/tomcat/shared/classes/alfresco-global.properties.install
$ sudo cp /opt/alfresco-old/tomcat/shared/classes/alfresco-global.properties /opt/alfresco/tomcat/shared/classes/

Default Alfresco installation can include following AMPs:

    • alfresco-share-services.amp

, to provide Share REST services

    • alfresco-aos-module-1.1.5.amp

, if SharePoint protocol has been selected

So, we are preserving these ones but copying previous AMPs for repo and share from 5.1.g to 201701 and applying them.


$ sudo cp /opt/alfresco-old/amps/* /opt/alfresco/amps
$ sudo cp /opt/alfresco-old/amps_share/* /opt/alfresco/amps_share
$ sudo /opt/alfresco/bin/apply_amps.sh

Configuring SOLR 6

As previous task, we are removing SOLR 4 installation files provided by Alfresco wizard installer.


$ sudo rm -rf /opt/alfresco/solr4
$ sudo rm -rf /opt/alfresco/alf_data/solr4

$ sudo rm /opt/alfresco/tomcat/conf/Catalina/localhost/solr4.xml

$ sudo rm /opt/alfresco/tomcat/webapps/solr4.war

Solr 6 integration is available at
Alfresco Solr 6 Integration 1.0.b, we are unzipping this file to Alfresco home folder.

$ sudo mkdir /opt/alfresco/solr6
$ sudo cp alfresco-search-services-1.0.b.zip /opt/alfresco/solr6
$ sudo unzip /opt/alfresco/solr6/alfresco-search-services-1.0.b.zip
$ sudo rm /opt/alfresco/solr6/alfresco-search-services-1.0.b.zip

We have Alfresco running in port 9080, so we need to modify core template properties before creating Alfresco workspace and archive cores. By default this template is configured to use port 8080.

$ cd /opt/alfresco
$ cd /opt/alfresco/solr6/solrhome/templates/rerank/conf
$ sudo vi solrcore.properties

alfresco.port=9080
alfresco.port.ssl=9443

We are running Alfresco SOLR 6 for the first time, so we need to ask for cores creation.

$ sudo solr/bin/solr start -force -a -Dcreate.alfresco.defaults=alfresco,archive

Once running, SOLR 6 web console will be available at http://localhost:8983/solr and it’s ready to be configured as Alfresco indexing subsystem at alfresco-global.properties.

### Solr indexing ###
index.subsystem.name=solr6
solr.host=localhost
solr.port=8983
solr.port.ssl=8984
solr.secureComms=none

We are declaring SOLR 6 as service to set memory parameters and to be started at boot time.

# cat solr6
#!/bin/sh
#
# chkconfig: 2345 80 30
# description: Alfresco Community SOLR6
#
### BEGIN INIT INFO
# Provides:          solr6
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Should-Start:      $all
# Should-Stop:       $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/stop Alfresco SOLR6
# Description:       Start/stop Alfresco SOLR6
### END INIT INFO

RETVAL=0

start () {
    /opt/alfresco/solr6/solr/bin/solr start -m 2G -force "$2"
    RETVAL=$?
    if [ -d "/var/lock/subsys" ] && [ `id -u` = 0 ] && [ $RETVAL -eq 0 ] ; then
        touch /var/lock/subsys/solr6
    fi

}

stop () {
    /opt/alfresco/solr6/solr/bin/solr stop -all "$2"
    RETVAL=$?
}


case "$1" in
    start)
        start "$@"
        ;;
    stop)
        stop "$@"
        ;;
    restart)
        stop "$@"
        start "$@"
        ;;
    *)
        /opt/alfresco/solr6/solr/bin/solr "$@"
        RETVAL=$?
esac
exit $RETVAL


$ service solr6 stop

$ service solr6 start

We have updated our Docker containers to include SOLR 6, so you can try at GitHub 201701-GA-solr6

Restoring repository from previous version (5.1.g)

We are moving all contents to new installation.

</pre>
<pre>$ rm -R /opt/alfresco/alf_data/contentstore
$ sudo mv /opt/alfresco-old/alf_data/contentstore /opt/alfresco/alf_data</pre>
<pre>

Note We are not moving SOLR 4 indexes, as we use SOLR 6.

We are restoring database backup from previous step.


$ sudo su - postgres

$ /opt/alfresco/postgresql/scripts/ctl.sh start

$ cd /opt/alfresco/postgresql/bin

$ ./psql

postgres=# drop database alfresco;
DROP DATABASE
postgres=# CREATE DATABASE alfresco
postgres-# WITH OWNER = alfresco
postgres-# ENCODING = 'UTF8'
postgres-# TABLESPACE = pg_default
postgres-# CONNECTION LIMIT = -1
postgres-# TEMPLATE template0;
CREATE DATABASE
postgres=# \q

$ exit

$ sudo /opt/alfresco/postgresql/bin/psql -U alfresco alfresco < /tmp/exportFile-20170214.dmp
$ sudo /opt/alfresco/postgresql/scripts/ctl.sh stop

Starting

By now, our 201701 Alfresco includes all data and customisations from Alfresco 5.1.g and it is ready to start.

So, once the service is started, we can access to the new orange login screen at http://localhost:9080/share.


$ service alfresco start

DISCLAIMER: This blog post describes a sample for Alfresco 5.1.g to Alfresco 201701 upgrading. However, your server can be different, so maybe different steps has to be done in your system. Moreover, shell commands are included only as samples: maybe copy-pasteying to your shell will not produce desired effects.

Responsable tecnológico para soluciones de gestión documental en keensoft. Especialista en Alfresco y en implantaciones de Administración Electrónica.

One Response to “Our road from Alfresco 5.1.g to Alfresco 201701”

  1. gius says : Reply

    Nice write up!
    I would to share my experience about the LibreOffice dependencies in Ubuntu 16.04 (amd64).
    It seems the issue is related with the full path where libgl1-mesa is located after installing. A symlink should fix this.
    Here is how I worked aroud it (see NOTE 2):
    http://www.giuseppeurso.eu/en/alfresco-tips-and-tricks-12-libraries-necessary-to-support-libreoffice-were-not-found/

Leave a Reply

TOP