cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 4.0.a Upgrade Guide (Ubuntu 10.04 - Zentyal)

citizenkane
Champ in-the-making
Champ in-the-making
Here is what worked for me. It does not implement Solr, but works fine with Lucene. (I can't get Solr to work yet)

This guide will preserve lucene indexing in favour of solr and use PostgreSql

It will keep Alfresco along with the PostgreSql, java, openoffice in a "container" as per the default install. This should make it easier to migrate and upgrade in the future.

STOP you old alfresco instance and back up alf_data as well as do a dump of the database.

Download the installation binary and save to <any directory>

sudo su
cd <any directory>./alfresco-community-4.0.a-installer-linux-x64.bin

Select "2" detailed install

Set install location to /var/opt/alfresco-4.0.a

Select all module options

Change all port mappings from default to avoid conflicts with the existing server (generally up by one digit)

Install Alfresco as a service

DO NOT ALLOW IT TO RUN if you are upgrading from previous database; follow these instructions:

Rename directory 'alf_data' to 'alf_data_virgin'

Restore your backed up 'alf_data' as 'alf_data'

copy the following directories from 'alf_data-virgin' to 'alf_data';

    'keystore'
    'postgresql'
    'solr'


Create a new database user (you will understand why when it comes to backing up):

createuser -P -U postgres -s -e -h /var/opt/alfresco-4.0.a/postgresql -p <new psql port as defined in install> <new user - same as your old database owner>

Create a new database:

sudo createdb -U <new user> -O alfresco -h /var/opt/alfresco-4.0.a/postgresql -p 5433 alfresco2

Restore your old database to the new:

psql -U <new user> -h /var/opt/alfresco-4.0.a/postgresql -p 5433 alfresco2 < <your database dump file>

(If the old database owner does not exist in the new database, Postgre will throw errors in the import)

Edit configuration:

/var/opt/alfresco-4.0.a/tomcat/shared/classes/alfresco-global.properties

to suite your environment and add the following to the bottom of the file:

# Index Recovery Mode
#————-
index.recovery.mode=FULL

Edit:

index.subsystem.name=solr

to:

index.subsystem.name=lucene

Initiate first run:

service alfresco start

Repair log file location:

change:

log4j.appender.File.File=/alfresco.log

to:

log4j.appender.File.File=/var/opt/alfresco-4.0.a/alfresco.log

in the following files:

    /var/opt/alfresco-4.0.a/tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties
    /var/opt/alfresco-4.0.a/tomcat/webapps/awe/WEB-INF/classes/log4j.properties
    /var/opt/alfresco-4.0.a/tomcat/webapps/share/WEB-INF/classes/log4j.properties


Complete configuration:

Edit:

/var/opt/alfresco-4.0.a/tomcat/shared/classes/alfresco-global.properties

index.recovery.mode=AUTO

and:

### E-mail site invitation setting ###
notification.email.siteinvite=true
mail.host=localhost
mail.port=25
mail.username=anonymous
mail.password=
mail.encoding=UTF-8
mail.from.default=<admin email>
mail.smtp.auth=false

to suite your server.

Edit:

/var/opt/alfresco-4.0.a/alf_data/postgresql/postgresql.conf

#port = 5432

to:

port = <your new database port> 



Restart Alfresco:

service alfresco restart

Cold backup script:

Establish authentication for postgres:

For pg_dump script authentication to work, the pg username and system username need to match.

su <username>
echo '*:*:*:<pg username>:<pg password>' > ~/.pgpass
chmod 0600 ~/.pgpass

Create a backup script to run from cron:

#!/bin/bash
bdate=`date +%F`
############## Cold Backup for Alfresco on PostgreSql
blocation="<backup location>"
busername="<username>" #This needs to be the same username for system and MySql in order for authentication to work
bdatabasename="<your database name>"
sudo mkdir -p $blocation/$bdate/alfresco
service alfresco stop
wait
sh /var/opt/alfresco-4.0.a/postgresql/scripts/ctl.sh start
wait
alfbackup() {
sudo -u $busername /var/opt/alfresco-4.0.a/postgresql/bin/pg_dump -U $busername -h /var/opt/alfresco-4.0.a/postgresql -p 5433 $bdatabasename > $blocation/$bdate/alfresco/$bdatabasename.dump
tar czf $blocation/$bdate/alfresco/alfresco.tgz /var/opt/alfresco-4.0.a/alf_data
}
alfbackup
wait
sh /var/opt/alfresco-4.0.a/postgresql/scripts/ctl.sh stop
wait
service alfresco start
############## Remove old backups
olddelete=`date –date="7 days ago" +%F`
sudo rm -r $blocation/$olddelete
10 REPLIES 10

ttownsend
Champ on-the-rise
Champ on-the-rise
Great post.  Seriously.
But it didn't work for me. 

Maybe you can help me troubleshoot?

My environment
Company is in the security field and is using Alfresco Share in an small production environment, so this is an important system.
Ubuntu 10.04 LTS Desktop x64 running as a VM in a 100GB space.  Vanilla install.  No existing alfresco or postgresql install.

Per the guide, installed /opt/alfresco- 4.0.c / with postgresql at port 5432 (Since no previous install to conflict with).

Create a new database user (you will understand why when it comes to backing up):


createuser -P -U postgres -s -e -h /var/opt/alfresco-4.0.a/postgresql -p <new psql port as defined in install> <new user - same as your old database owner>


I didn't need to (actually couldn't) create user postgres since there one already existed from the fresh alfresco install I just did.

Create a new database:

sudo createdb -U <new user> -O alfresco -h /var/opt/alfresco-4.0.a/postgresql -p 5433 alfresco2

Creating the new database with the command you gave returns "could not connect to the database postgres".  I assumed that -p 5433 was to basically create a parallel install of alfresco beside alfresco if there had been an existing alfresco/postgres install.  Since not, I opted for port 5432. to make a connection to postgres, and created alfresco3 (my 3 = your 2 in the guide) with user alfresco as the owner.


Restore your old database to the new:

psql -U <new user> -h /var/opt/alfresco-4.0.a/postgresql -p 5433 alfresco2 < <your database dump file>

(If the old database owner does not exist in the new database, Postgre will throw errors in the import)

Then at this point I follow the guide again, and having settings as alfresco3 for the database and  5432 as the postgresql port.




I am currently at a system state where:
http://server:8080/alfresco returns a 404
http://server:8080/share opens the Share login screen
unable to login

http://server:8080/alfresco returns a 404
http://server:8080/share opens the Share login screen
unable to login

My questions:
Should I have set my postgresql port to 5433 in the initial Alfresco install?
Do you see any mistakes?
Is there anything missing from the guide?

Many sincere thanks in advance.

cjimenez2581
Champ in-the-making
Champ in-the-making
db.name=alfresco
db.username=alfresco
db.password=alfresco
db.host=localhost
db.port=5433
db.driver=org.postgresql.Driver
db.url=jdbcSmiley Tongueostgresql://${db.host}:${db.port}/${db.name}

hso
Champ in-the-making
Champ in-the-making
I'm on a fresh install of 4.0.c on Ubuntu 11.10, but used your backup script.
Works perfect so thanks for a great post!

PS. to other users reading this: pg_dump automatically reads the password for  $busername in the .pgpass file. It took me a while to realise… 🙂

hso
Champ in-the-making
Champ in-the-making
@TTownsend

If you are installing a fresh install, are you not just using the normal install script that came with the install file?

You say you can't log in when you go to http://server:8080/share - are you using the username you created when you set up the server?
If so - have you changed the dir.root parameter in the alfresco-global.properties to move your data to a separate location? If so - you need to stop the alfresco service (sudo service alfresco stop) and move the content of the original alf_data folder to the new location.

Does that help?

ttownsend
Champ on-the-rise
Champ on-the-rise
Hi,

I've been tied up today, so I will try this out tomorrow.  I will let you know how I make out.

Many thanks,
Trevor

sharifu
Confirmed Champ
Confirmed Champ
I have tried this and i get the errors I have mention on page 3 of this thread https://forums.alfresco.com/en/viewtopic.php?f=8&t=41222&start=30%20

ttownsend
Champ on-the-rise
Champ on-the-rise
Does anyone now if this procedure will work for upgrading from 4.0.e to 4.2.a ?

sharifu
Confirmed Champ
Confirmed Champ
Yes it does as I have 1 test box working fine and another not working fine.

make sure you back up mysql, then content store, then your model

install 4.2a
copy over your contentstore and set the following in global properties file


replication.enabled=false

db.schema.update=true

#
# Index Recovery Mode
#————-
index.recovery.mode=FULL

### E-mail site invitation setting ###
activities.feed.notifier.enabled=false

### CIFS Server Configuration ###
cifs.serverName=${localname}

#rmi#
#monitor.rmi.service.port=50508
#alfresco.rmi.services.external.host=172.16.0.49

change the following line to


### Solr indexing ###
index.subsystem.name=lucene


copy over mysql jar file and ibatis if needed and your model

ttownsend
Champ on-the-rise
Champ on-the-rise
Okay - tried it out hacked a bit for a postgresql install, but I managed to get something working.

So you've disable SOLR in favour of LUCENE?