cancel
Showing results for 
Search instead for 
Did you mean: 

Upgrade Issue

ash85
Champ in-the-making
Champ in-the-making
Upgrading from 3.4.a to 3.4.d

I have replaced the alf_data in 3.4.d with the one we had backed up in 3.4.a. Also do we need to replace entire mysql folder or just data subfolder in mysql ?

The alfresco.log on 3.4.d shows this error :

  • 15:52:32,905 WARN  [org.hibernate.cfg.SettingsFactory] Could not obtain connection metadata
  • org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'alfresco'@'localhost' (using password: YES))                          at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
            at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)                                                                                         at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
            at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)                                                                                                at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073)
            at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1298)                                                                                            at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:855)
            at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:774)                                                        at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)                            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)                                  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)                                                                 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)                                                                   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
            at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
  • 10 REPLIES 10

    gnyce
    Champ in-the-making
    Champ in-the-making
    You don't say what you did, db-wise.  Typically you replace the new install's alf_data with your previous version's alf_data, as well as the previous version's "alfresco" mysql db.  The new version, when it starts up, recognizes the DB is from a previous version, does some schema updates, etc. applies some patches, and so on.

    ash85
    Champ in-the-making
    Champ in-the-making
    So the entire mysql folder in 3.4.d needs to be replaced by 3.4.a mysql folder and not just the data folder ?

    gnyce
    Champ in-the-making
    Champ in-the-making
    Egads, no - you start replacing folders and files willy-nilly, you will likely get yourself in trouble with mysql.  Am by no means an expert, but in testing, here is what I do, roughly.

    - take a mysqldump of alfresco mysql database of to-be-upgraded version to a file
    - drop the database; create a new blank one of the same name
    - install new Alfresco version… start Alfresco… shut it down
    - replace new alf_data with the original content (previous version)
    - drop alfresco database; create new blank one of same name (you could just drop all tables but keep the actual DB)
    - restore the mysqldump to this (now blank) database 
    - start Alfresco… it recognizes the older DB schema, content… starts the 'upgrade' process if there is any (e.g. schema and DB changes, and so on)

    ash85
    Champ in-the-making
    Champ in-the-making
    drop alfresco database; create new blank one of same name (you could just drop all tables but keep the actual DB)


    sorry i am new to this but could you explain what needs to be done here exactly ?

    the folder is mysql. so delete this folder ?

    cheers

    gnyce
    Champ in-the-making
    Champ in-the-making
    No, don't delete any folders.  Let's get some basic information.

    What OS are you using? 
    What version of MySQL - or are you using the bundled MySQL that comes with Alfresco? 
    How did you upgrade… did you install to a new location (e.g. new folder)?
    Can I assume that this is not "production"?
    Did you read the wiki article on backup and restore?  http://wiki.alfresco.com/wiki/Backup_and_Restore
    Your new installation… is it using the "new" (e.g blank) database?

    ash85
    Champ in-the-making
    Champ in-the-making
    Hi,

    What OS are you using?

    Centos 5.

    What version of MySQL - or are you using the bundled MySQL that comes with Alfresco?

    Bundled one with alfresco.

    How did you upgrade… did you install to a new location (e.g. new folder)?

    Installed 3.4.d on same machine where 3.4.a is installed.

    Can I assume that this is not "production"?

    Dont understand what "production" here means .

    Did you read the wiki article on backup and restore? http://wiki.alfresco.com/wiki/Backup_and_Restore

    Yes i did and its not very clear to novices.

    Your new installation… is it using the "new" (e.g blank) database?

    Yes new blank db.

    Thanks

    ash85
    Champ in-the-making
    Champ in-the-making
    In mysql folder of 3.4.a i have

    alfresco folder
    ibdata1
    ib_logfile0
    ib_logfile1
    test folder
    mysql folder

    now in newly created 3.4.d i have same things . so in order to get data on 3.4.d from 3.4.a . what files i need to replace ?
    that is my simple question.
    i have already replaced alf_data in 3.4.d by backed up alf_data of 3.4.a . which contained backup-lucene-indexes , contentstore ,contentstore.deleted, lucene-indexes , oouser .

    So from what i understand i have restored alf_data but cant figure out which files need to be replaced in mysql folder in 3.4.d.
    the data sub folder in mysql folder has files as mentioned above and please could anyone tell me what to replace. in plain simple english as i am still in learning process here.

    thanks a million

    gnyce
    Champ in-the-making
    Champ in-the-making
    I don't use the bundled mysql, so I can't give letter-perfect instructions, but hopefully this is close enough. 

    So let's assume you have two installs… /opt/alf3.4.a/  and /opt/alf3.4.d/  (I don't know what you called them, but this is just an example for you)
    Basically, you want to backup the mysql db from /opt/alf3.4.a and restore it to /opt/alf3.4.d

    Shutdown Alfresco. 

    1) Go to the /opt/alf3.4.a/  directory.  First we will start the bundled mysql db:   /opt/alf3.4.a/mysql/scripts/ctl.sh start
    2) Next we will backup the previous alfresco db to a file.  You will need the mysql root password you were prompted for when you installed this… substitute it for PASSWORD:  /opt/alf3.4.a/mysql/bin/mysqldump -uroot -pPASSWORD alfresco > /tmp/alfresco.sql
    3) Confirm that the database dump is there:  less /tmp/alfresco.sql
    4) Once you've confirmed that you have data, shutdown the previous bundled-mysql:  /opt/alf3.4.a/mysql/scripts/ctl.sh stop
    5) Start the new bundled-mysql of the 3.4.d install:  /opt/alf3.4.d/mysql/scripts/ctl.sh start
    6) We will now drop that database, and then create a blank one:  /opt/alf3.4.d/mysql/bin/mysql -uroot -pPASSWORD
            show databases;    (one should be called 'alfresco')
            drop database alfresco;
            create database alfresco;
            quit
    7) Next, we'll restore the backup we made into this new/empty alfresco database:  /opt/alf3.4.d/mysql/bin/mysql -uroot -pPASSWORD alfresco < /tmp/alfresco.sql
    8 ) When it is done, shutdown the bundled mysql:  /opt/alf3.4.d/mysql/scripts/ctl.sh
    9) Start the new alfresco, and then watch the catalina.out logfile;  /opt/alf3.4.d/alfresco start;  tail -f /opt/alf3.4.d/tomcat/log/catalina.out

    Hopefully this is good enough to get you through.  Finally, I don't means this as a criticism, but I think you need a little more general background knowledge of Linux under your belt if you are going to be supporting/using this. 

    Good luck

    ash85
    Champ in-the-making
    Champ in-the-making
    Thanks man, i managed to get the database recovered last night.
    Thanks for your step by step guide. Yes i am new to linux and learning everyday.