Alfresco community upgrade procedure in Linux (tested on Ubuntu 12.04 LTS).
The upgrade shown here is from Alfresco Community 4.0.d to Alfresco Community 4.2.c. If version 4.0.e is the case, just find and replace “4.0.d” with “4.0.e” to get the right commands.
Needless to say that I don’t feel (so I am not) responsible for any damage that may happen after following the given instructions. My intention is to provide the community with an all-in-one procedure, as I found great difficulties gathering the puzzle pieces from different resources.
The steps below have been tested in a small production installation, giving perfect results (after many improvisations…). Given that, and the fact that right now I don’t consider myself as an expert administrator on large or complicated Alfresco systems, it is strongly recommended not to skip the backup step before messing around with anything vital.
And, of course, any feedback will be greatly appreciated.
Assumptions:
/opt/alfresco-4.0.d/
as the installation directory- postgresql as the database handler
- Default installation procedure (from binaries)
- Solr as the indexing engine (PLEASE NOTE: this how-to does not include transferring the indexes from old installation to the new one. So you have to wait for the indexes to be recreated after the upgrade, and that means a great amount of time in case of large document libraries)
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 /opt/backup_of_alfresco-4.0.d -R
– Turn off indexing inside the old installation (thanks to Loftux from Alfresco forum for the advise):
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=noindex
dir.keystore=${dir.root}/keystore
#solr.port.ssl=8443
– Start and stop alfresco server (throw a delay of 5 minutes between the two commands in order for the server to start properly):
root@alftest:~# sh /opt/alfresco-4.0.d/alfresco.sh start && sleep 300 && sh /opt/alfresco-4.0.d/alfresco.sh stop
(the quote above consist of one command)
– 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 (many thanks to Stefan in the comments bellow for pointing us to use the correct postgresql binaries):
root@alftest:~# su postgres
$ cd /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:
root@alftest:/etc# rm /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.d && 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 off 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
$ cd /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:
$ ./createdb -T template0 alfresco -h localhost
Password:
$ ./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/
(the quote above consist of two commands)
– Start and stop the new alfresco server (again wait for 5 minutes between the two commands for the server to start properly):
root@alftest:~# sh /opt/alfresco-4.2.c/alfresco.sh start && sleep 300 && sh /opt/alfresco-4.2.c/alfresco.sh stop
(the quote above consist of one command)
– Revert the indexing back to on (Solr):
In /opt/alfresco-4.2.c/tomcat/shared/classes/alfresco-global.properties
turn
### Solr indexing ###
index.subsystem.name=noindex
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
– Make any modification (in configuration files, etc) to match your installation scheme.
– Start the server and, after a while, try to login. Inspect logs for errors.
– Delete old installation directory (but do keep the backed up for a while):
root@alftest:~# rm /opt/alfresco-4.0.d -R
Great post! Thanks a lot! For me it worked on Ubuntu 10.04 LTS aswell.
Glad to hear, Alex.
Thanks for letting us know!
Great prost !!!
Migrated from alfresco-4.0.e to alfresco-4.2.b perfectly … also worked for me on Debian 6.0.5 x64
Is there instructions for Windows based installation?
(Sorry for late answering)
No Randy, I have not seen any around and I haven’t any experience on Alfresco under Windows.
Also for me a perfect instruction. Only a little hint: Using Debian 6 the standard postgres version is 8.x so it is not compatible with the 9.x from alfresco 4.x. therefore is is necessary to change to alfresco/postgres/bin folder and use the pb_dump from this folder. then you do not have to install any postgres packages.
Thanx for the hint Stefan!
As this could be a general policy (even just for software economy), as soon I have a little time I’ll test it on Ubuntu and embed it inside the post.
Thanks. This was the procedure I was hoping to find. Thank you so much. It works! It works! It works! I would love to know why we have to do some of the steps, and Im hoping to do more research later to get a better understanding. But for now, THANKS.
I did 4.0.0 (b) to 4.2.b on UBUNTU 12.04 LTS, running on a Macbook Pro. Now I can upgrade our production Alfresco!!!
Had some problems. Wiki pages (just content) do not show after upgrade. After deletion via blabla:8080/alfresco and recreating them all is well
We didn’t have such problems here, I run this guide 3 times on our server, with content including wiki pages. We experienced some bugs after upgrade, but those exist in the new version in any case.
Could you write what your OS is and what kind of installation are you on? Also, have you done any modifications that may interfere?
I have a Windows Alfresco upgrade procedure document. I used the Linux information and tweaked it for Windows. Its very similar, except the DB backup had to be a dump_all (at least for me).
Id like to share the document, but I dont know where to put it. Who can offer help. FYI – I went to the Alfresco WIKI, but I just dont get how that works. We have WIKIS, and they are easy to use!
Hi Mike iam really interested in your procedure as iam having some difficulties doing the upgrade. Is there anyway you could share it?
thank you
db
Hi Mike, sorry for late answering (apologies go to David too).
I am not sure what the problem is. In order to share our HowTo we went to Alfresco Forums (https://forums.alfresco.com/), and especially in the “Installation & Upgrades” section (https://forums.alfresco.com/forum/installation-upgrades-configuration-integration/installation-upgrades). Isn’t that suitable for you?
We’ll be glad to “host” your document on our site, if you have any problem posting it to Alfresco Forums, but I think posting there will give it the publicity it deserves.
What are you thinking about it?
Hi Mike,
I would love to have a copy of your procedure. We are due to upgrade from version 4.0.e to 4.2.c
Thanks!
Hi all,
GREAT WORK!! This HOW-TO can be used with a little bit of creativity on WINDOWS too!
Tested when moving from WinXP Alfresco 4.0.e to Win2008x64 Alfresco 4.2.c
THANKS A LOT!!
I’ve got a problem during the backup of the postgresql database
I get the following error:
pg_dump: server version: 9.0.2; pg_dump version: 8.4.13
pg_dump: aborting because of server version mismatch
Can someone help me with this isuue…?
itried the following backup command: pg_dump -h localhost -U alfresco alfresco > /tmp/alfrescodump
Would be great if someone knows a solution?
Philipp
Hi Philipp!
I guess it has to do with Stefan’s comment above, thus you may try to use Alfresco installation’s postgresql binaries instead of the ones installed in the system.
I’m on the run right now, but I will update the HowTo (as promised long-long time ago…) to give the exact commands of this optimization, hopefully within 24h.
Stay tuned.
Ok, here you go. The HowTo was updated!
Hope the problem you had has gone away.
Great guide, I have a question. I did an upgrade and moved it from Red Hat to Unbuntu 12. My question, on a new install of 4.2c the login page has a nice new background. After I did my upgrade, it still has the old background and login page. Any advice would be cool, I figure I will find out the problem when I try to add a ” forgot my password function to the login page.
Thanks.
Followed your guide and it works pretty well!
One thing though … the “sample web site design project” that I deleted before is back! And I can not delete it … nor become a member of it. Quite annoying …
Thanks for the tutorial! You have a typo as the first reference to:
cd /opt/alfresco-4.2.c/postgresql/bin/
should be:
cd /opt/alfresco-4.0.d/postgresql/bin/
Thank you Andrew! I just corrected this.
I hope you were the first to find this out, and not just the first to report it.
Hi Kostos,
I join the other to send you a warm “thank you”!
It worked like a charm 🙂
Thanks again for the detailed procedure,
Fabrice.
Sorry, I’ve misspelled your name.. Thanks Kostas!
Thanx, glad to be useful!
Hey all,
I am trying this on 4.0.c to 4.2.e, and, when starting the upgraded server for the first time, I came across this in catalina.out:
2014-03-10 11:39:49,912 ERROR [admin.patch.PatchExecuter] [localhost-startStop-1] 02100002 org.alfresco.error.AlfrescoRuntimeException: 02100001 Bootstrap failed
On starting the server for the second time after upgrading, the same bootstrap error appears in catalina.out and I cannot log in using either the admin account or my username.
Any ideas? Many thanks in advance!
Hi!
Sorry, never came across this error. At the Alfresco Forums they say that maybe this error refer to file permissions problems. I think you ‘ve better ask them, as they are more experienced than I am.
It looks like it’s a bug/disabled feature that breaks backwards compatibility (https://issues.alfresco.com/jira/browse/ALF-20032?jql=text%20~%20%22patch.sharedFolder%22)
I’ll try the fix and see what happens.
Thanks for your instructions!
I hope you’ll manage to sort this out. Any feedback is welcomed.
Thanks alot, I did many attempt upgrade 4.0e to 5.0a and many weird errors that cannot be solved. thanks to your post I upgraded from 4.0e ->4.2f ->5.0a without problem
thanks
Glad we helped!
Hi guys!
It’s very interesting guide. I have a problem: who knows how to make downgrade alfresco from 5.x.x to 4.2.x?