Alfresco Community 4.0.d to 4.2.c upgrade procedure / HOW-TO

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.


  • /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/ 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/ turn

### Solr indexing ###


### Solr indexing ###

– 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/ start && sleep 300 && sh /opt/alfresco-4.0.d/ stop

(the quote above consist of one command)

– Start Alfresco postgresql:

root@alftest:~# sh /opt/alfresco-4.0.d/ 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
$ exit

– Stop Alfresco postgresql:

root@alftest:~# sh /opt/alfresco-4.0.d/ 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/ 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
$ ./createdb -T template0 alfresco -h localhost
$ ./psql alfresco -h localhost < /tmp/alfrescodbdump
$ exit

– Stop new Alfresco postgresql:

root@alftest:~# sh /opt/alfresco-4.2.c/ 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/ start && sleep 300 && sh /opt/alfresco-4.2.c/ stop

(the quote above consist of one command)

– Revert the indexing back to on (Solr):
In /opt/alfresco-4.2.c/tomcat/shared/classes/ turn

### Solr indexing ###


### Solr indexing ###

– 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

Tagged with: , , ,
32 comments on “Alfresco Community 4.0.d to 4.2.c upgrade procedure / HOW-TO
  1. alex says:

    Great post! Thanks a lot! For me it worked on Ubuntu 10.04 LTS aswell.

  2. Kostas Katsaros says:

    Glad to hear, Alex.
    Thanks for letting us know!

  3. Angel says:

    Great prost !!!

    Migrated from alfresco-4.0.e to alfresco-4.2.b perfectly … also worked for me on Debian 6.0.5 x64

  4. Stefan says:

    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.

    • Kostas Katsaros says:

      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.

  5. mike chase says:

    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!!!

  6. user says:

    Had some problems. Wiki pages (just content) do not show after upgrade. After deletion via blabla:8080/alfresco and recreating them all is well

    • Kostas Katsaros says:

      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?

  7. Mike Chase says:

    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!

  8. Smart says:

    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

  9. Philipp says:

    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?


    • Kostas Katsaros says:

      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.

  10. Patrick says:

    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.

  11. Ton says:

    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 …

  12. Andrew Perry says:

    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/

    • Kostas Katsaros says:

      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.

  13. Fabrice says:

    Hi Kostos,

    I join the other to send you a warm “thank you”!
    It worked like a charm 🙂

    Thanks again for the detailed procedure,

  14. 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!

  15. kossel says:

    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


  16. Konstantin says:

    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?

1 Pings/Trackbacks for "Alfresco Community 4.0.d to 4.2.c upgrade procedure / HOW-TO"
  1. […] are so many instructions on how to upgrade Alfresco. They all basically boil down […]

Leave a Reply

Your email address will not be published. Required fields are marked *