cancel
Showing results for 
Search instead for 
Did you mean: 

The data directory was initialized by PostgreSQL version 9.0, which is not compatible with this version 9.2.4.

patricck20
Champ in-the-making
Champ in-the-making
Hi all,

i am trying to migrate alfresco from 4.2.c to 4.2.d, but after the migration, i am unable to start the postgresql. In logs i see:

The data directory was initialized by PostgreSQL version 9.0, which is not compatible with this version 9.2.4.

Any ideas how to proceed? I want to upgrade from 4.2.c > 4.2.d > 4.2.e > 4.2.f > 5

Thanks
6 REPLIES 6

eswbitto
Confirmed Champ
Confirmed Champ
What is your procedure for migrating between versions? I think the best solution is to create a dump of your database and then load it into your new version that way. Between those two versions I don't think you can just point the new installation to your repository and database.

patricck20
Champ in-the-making
Champ in-the-making
Hi ESWBitto,

thanks for the answer, i have made the upgrade like this:

Installed a new debian OS on a VM. Downloaded and installed Alfresco 4.2.d on the new system (default install with postgresql).


sh /opt/alfresco-4.2.c/alfresco.sh start postgresql
su – postgres
cd /opt/alfresco-4.2.c/postgresql/bin/
./psql
DROP DATABASE alfresco;
CREATE DATABASE alfresco WITH OWNER alfresco;

Digit CTRL+d to exit from the shell.
psql -U alfresco -d alfresco
ALTER USER alfresco WITH PASSWORD ',,,,,,,,';

./pg_restore -d alfresco /usr/src/db.tar
exit


cd /opt/alfresco
mv alf_data alf_data.old
tar zxvf /usr/src/data.tar.gz

cp –p /alf_data to alfresco data
Change back owners

Copy alfresco config file
service alfresco start


this is not correct ?

eswbitto
Confirmed Champ
Confirmed Champ
I have used this script (with some changes)in order to create my database dump. HERE
It is a great tool that fcorti came up with. Anywho, what you need to do in your 4.2.c install is go to the /home/postgresql/bin/and use the pg_dump to create the dump file. Then in your new installation put the dump file in the same file location as the home/postgresql/bin pg_restore.

So you should try this.

1. Create dump from old install.
2. Copy entire alf_data folder to new install (make sure that you haven't started the service on the new install at all.)
3. In alf_data folder(the one you copied over from old install)got to postgresql folder and rename to postgresql.old (something like that)
4.go to home/postgresql/bin/pg_restore and then give the source file and then the destination to put the content to.

start the service and see what happens….pray….cross fingers…all that good stuff.

patricck20
Champ in-the-making
Champ in-the-making
Hi,

thanks for the answer. the issue is i think that old alfresco was installed on postgresql 9.0 and new version runs on 9.2 - and something is different.

I have tried pg_restore, but same issue. Do i need to do first a Pg_upgrade on the old install ?

patricck20
Champ in-the-making
Champ in-the-making
Hi, so tested again. I have made it as you said, when i am starting the new instance, it gives me:
:/opt/alfresco-4.2.d# service alfresco start postgresql
waiting for server to start…….. stopped waiting
pg_ctl.bin: could not start server

Examine the log output.

the log says:

pg_ctl.bin: could not start serverFATAL:  database files are incompatible with server
DETAIL:  The data directory was initialized by PostgreSQL version 9.0, which is not compatible with this version 9.2.4.

With pg_upgrade i get the following error:

$ ./pg_upgrade -d /opt/alfresco-4.2.c/alf_data/postgresql/ -D /opt/alfresco-4.2.d                                                                                       /alf_data/postgresql/ -b /opt/alfresco-4.2.c/postgresql/bin -B /opt/alfresco-4.2.                                                                                       d/postgresql/bin –v
Performing Consistency Checks
—————————–
Checking current, bin, and data directories                 ok
Checking cluster versions
This utility can only upgrade to PostgreSQL version 9.2.
Failure, exiting


Regards
Patrik

eswbitto
Confirmed Champ
Confirmed Champ
OK try this…

on the 4.2.c navigate to home/alfresco4.2.c/posgresql/bin do a

./pg_dump -Fc alfresco > backup.pgb


Now go to the new install with this file and do a restore.

Put the file in  /home/alfresco4.2.d/bin

Now you need to create a new database in the new install.

./psql -U postgres -h localhost

create DATABASE alfresco_42c;

Now restore database backup to the NEW database.

./pg_restore -d alfresco_42c backup.pgb


Also make sure you move the alf_data from the old install to the new one. You may need to remove the indexes.

Now start the service in the new install for the first time. (Also make sure your alfresco-global.properties for the database settings reflect the new info.