Alfresco community upgrade procedure in Linux (tested on Ubuntu 12.04). Upgrade from Alfresco Community 4.0.d to Alfresco Community 4.2.c.
Assuming:
– /opt/alfresco-4.0.d/ as the installation dir
– postgresql as the database handler
– Default installation procedure (from binaries)
– SOLR as the indexing engine (this how-to does not include transferring the indexes from old installation to the new one)
Upgrade steps:
– Stop Alfresco server:
root@alftest:~# sh /opt/alfresco-4.0.d/alfresco.sh stop
– Make a complete backup of alfresco installation:
root@alftest:~# cp /opt/alfresco-4.0.d backup_of_alfresco-4.0.d
– Switch the old installation (/opt/alfresco-4.0.d) to lucene indexing engine instead of solr:
In /opt/alfresco-4.0.d/tomcat/shared/classes/alfresco-global.properties turn
### Solr indexing ###
index.subsystem.name=solr
dir.keystore=${dir.root}/keystore
solr.port.ssl=8443
into
### Solr indexing ###
index.subsystem.name=lucene
dir.keystore=${dir.root}/keystore
#solr.port.ssl=8443
– Start and stop alfresco server (wait for 5 minutes between the two commands for the server to start properly):
root@alftest:~# sh /opt/alfresco-4.0.d/alfresco.sh start
(wait for 5′, then)
root@alftest:~# sh /opt/alfresco-4.0.d/alfresco.sh stop
– Start Alfresco postgresql:
root@alftest:~# sh /opt/alfresco-4.0.d/alfresco.sh start postgresql
– Dump (backup) the entire alfresco postgresql database to a script file (the postgres user password will be asked, use the one that you gave during the Alfresco installation):
root@alftest:~# su postgres
$ /opt/alfresco-4.0.d/postgresql/bin/pg_dump -h localhost alfresco > /tmp/alfrescodbdump
Password:
$ exit
– Stop Alfresco postgresql:
root@alftest:~# sh /opt/alfresco-4.0.d/alfresco.sh stop
– Delete (or move to somewhere else) the startup file /etc/init.d/alfresco.
– Backup any alfresco log files that may exist outside the installation directory (e.g. mv /var/log/alfresco /var/log/alfresco.4.0.e && mkdir /var/log/alfresco)
– Install the new Alfresco release (for me it was community 4.2.c) to a new directory. It is recommended to keep the same Admin Password as in the old one. Do NOT start Share during installation (answer “no” when asked to).
– Make the essential configurations inside the new installation (e.g. server’s hostname, etc) AND turn indexing to lucene as in the corresponding step above.
– Start new installation’s postgresql:
root@alftest:~# sh /opt/alfresco-4.2.c/alfresco.sh start postgresql
– Drop new installation’s database, create the new one and restore the above backed up:
root@alftest:~# su postgres
$ /opt/alfresco-4.2.c/postgresql/bin/dropdb alfresco -h localhost -i
Database “alfresco” will be permanently removed.
Are you sure? (y/n) y
Password:
$ /opt/alfresco-4.2.c/postgresql/bin/createdb -T template0 alfresco -h localhost
Password:
$ /opt/alfresco-4.2.c/postgresql/bin/psql alfresco -h localhost < /tmp/alfrescodbdump
Password:
(…)
ALTER TABLE
ALTER TABLE
REVOKE
REVOKE
GRANT
GRANT
$ exit
– Stop new Alfresco postgresql:
root@alftest:~# sh /opt/alfresco-4.2.c/alfresco.sh stop
– Move content storage to new installation’s storage. You HAVE backup, remember?…
root@alftest:~# cd /opt/alfresco-4.0.d/alf_data/
root@alftest:/opt/alfresco-4.0.d/alf_data# mv contentstore contentstore.deleted /opt/alfresco-4.2.c/alf_data/
– Start and stop the new alfresco server (wait for 5 minutes between the two commands for the server to start properly). Don’t try to make use (login, etc) of the server in between the two commands:
root@alftest:~# sh /opt/alfresco-4.2.c/alfresco.sh start
(wait for 5′, then)
root@alftest:~# sh /opt/alfresco-4.2.c/alfresco.sh stop
– Revert the indexing engine from lucene back to solr:
In /opt/alfresco-4.2.c/tomcat/shared/classes/alfresco-global.properties turn
### Solr indexing ###
index.subsystem.name=lucene
dir.keystore=${dir.root}/keystore
#solr.port.ssl=8443
into
### Solr indexing ###
index.subsystem.name=solr
dir.keystore=${dir.root}/keystore
solr.port.ssl=8443
– Delete old installation directory (but do keep the backed up for a while):
root@alftest:~# rm /opt/alfresco-4.0.d -R
– Start the server and, after a while, try to login. Inspect logs for errors.
Worked perfectly! Thanks for the post.
I was using Debian 6.0 VM, running Alfresco 4.0.e, using a standard Postgresql install.
I upgraded to Alfresco 4.2.e Community.
Glad to read it. Thanx for the feedback!