Alfresco upgrade from 4.0.0 community with postgres DB to 5.0.d

cancel
Showing results for 
Search instead for 
Did you mean: 
sanketmohite
Active Member

Alfresco upgrade from 4.0.0 community with postgres DB to 5.0.d

All.

We are courrently using alfresco 4.0.0 community version with postgres DB and trying to upgrade to 5.0.d.

We installed new alfresco but we noticed that tables in new are totally different.

So Need guidance on how we cna get existing postgres data migrated to new version?

5 Replies
jpotts
Professional

Re: Alfresco upgrade from 4.0.0 community with postgres DB to 5.0.d

When you start Tomcat with the new WAR files, there is a built-in process that will run to update the schema.

Before you do this, use pg_dumpall to take a backup of your database, then copy that and your content store somewhere safe. That way, if you need to back out you can always just dump and load your old database, replace your content store, then start up with the old WAR files.

You should also read various blog posts and documentation on this subject.

mehe
Senior Member II

Re: Alfresco upgrade from 4.0.0 community with postgres DB to 5.0.d

I usually backup my alfresco Data like Jeff stated above, copy the lastest 4.x war file to my Alfresco Tomcat webapps directory, startup alfresco and check the logs for db-schema update/error messages. Backup the resulting DB again, Install the desired 5.x Version of Alfresco in an new place (or move the old installation out of the way...) as new instance (empty). Check that it comes up and is working like expected - shut it down, delete the new DB and the new (empty) contentstore, import my backuped DB, copy my content in the new alf_data/contentstore directory.

Then startup alfresco and watch out for errors in the log.

I do the described update to the latest 4.x war, to make shure that the DB schema is the latest 4.x, because I had Problems with updating in "big steps".

sanketmohite
Active Member

Re: Alfresco upgrade from 4.0.0 community with postgres DB to 5.0.d

Hi Jeff

Thanks for your quick response!!

To reconfirm my understanding, following are high level steps can be followed to retain existing 4.0 data in 5.0 version

1. Install Alfresco 5.0 version and ensure if working fine

2. Down services of  Alfresco 5.0

3. Configure CMS_Data of Alfresco 4.0 in the Alfresco 5.0

4. Configure Alfresco 5.0 DB parameter to point to postgres schema of Alfresco 4.0

5. Start Services of Alfresco 5.0 which will upgrade to new structure during startup?

Also confirm on following point

Currently my Alfresco 4.0 is running on Linux 5.4 with postgres 9.2.9.20. How critical it is to update to Linux 6.5 64 bit and postgres 9.3.6?

Awaiting your suggestions.

jpotts
Professional

Re: Alfresco upgrade from 4.0.0 community with postgres DB to 5.0.d

Yes, I think you've got it.

Regarding your Linux and Postgres, I assume you are talking about

RHEL/CentOS. It is risky to do in-place upgrades of RHEL/CentOS to new

major versions. It is almost always better to install a fresh server and

migrate to it from the old server.

I definitely think you should run the newer OS and database so that you'll

be on the "supported stack" for 5.0.

When upgrading PostgreSQL, I always use the newer version of pg_dump to run

against the older PostgreSQL database to avoid any issues that might be

created by having a dump from the old version. If you are running

PostgreSQL as shipped with Alfresco the process looks like:

1. Stop Alfresco.

2. Using the old Alfresco's postgres script in

$ALFRESCO_HOME/postgresql/scripts/ctl.sh, start the old posgres server.

3. Switch to the new Alfresco postgres binary folder and use pg_dumpall to

dump the database.

4. Stop the old Alfresco postgres.

5. Start the new Alfresco postgres.

6. Use the new Alfresco postgres psql to load the dump.

Of course if you end up using two different servers to address the Linux

upgrade, these steps are a little more complicated. You could install the

old Alfresco on the new server and start it up to make sure it is good,

then you'd have everything you'd need to follow these steps.

On Tue, Mar 21, 2017 at 2:30 AM, sanketmohite <community@alfresco.com>

mehe
Senior Member II

Re: Alfresco upgrade from 4.0.0 community with postgres DB to 5.0.d

If you are able to setup a second server, you won't have any pressure that the new installation has to work instantly. If the upgrade on the new server fails, you always have the old one as fallback.

So, in your place, I would setup the new Linux box with a supported Linux version, install Alfresco 5 to it and transfer configuration, contentstore(s) and the db dump to the new system. The db commands in postgresql/VERSION/bin can be executed if you "su" to the postgres user.

If you have the time and your amount data is not too big, you could even test-upgrade on a virtual machine - but this vm needs a lot of resources, mainly memory Smiley Happy

Also have a close look on Upgrading | Alfresco Documentation (use the dos matching your version) and also look for new configuration options that are eventually missing in the old version.

Like Jeff Potts‌ already showed, Alfresco tries to update your db Schema on startup.

I had problems to upgrade directly from 4.0x to 5.x, but I don't know if this was just my fault or a general problem, so I started the last 4.x version alfresco.jar (no full install, just copied the war in the tomcat/webapps instead of the old one) which upgraded my db-Schema to the latest 4.x and used the reulting db for the Alfresco 5 upgrade.

good luck (only in case you need it, no offence Smiley Happy )