cancel
Showing results for 
Search instead for 
Did you mean: 

Upgrade 3.4d to 4.0b can't restore data

tross
Champ in-the-making
Champ in-the-making
I have tried a couple times to upgrade from Alfresco Community 3.4d to Alfresco 4.0b (with patch), as well as a nightly build of Alfresco 4.0c.  I can upgrade to a clean empty 4.0b instance, but when I try to move the 3.4d repository data and database back into place, I can no longer get into /share or /alfresco (404 errors).  I'm hoping that someone may be able to tell me what I'm doing wrong with the data backup and restore procedure.  I am running on Red Hat Linux 5.  I have a separate app server and Mysql database server.

I followed the Wiki page regarding Backup and Restore, but it is not particularly specific. 

To backup I do these steps: 1) Stop Alfresco App and htpd process;  2) Run mysqldump command on Alfresco Database to dump current database to a file (alfresco_bkup.sql); 3) Make a copy of the entire alf_data repository directory structure in a /temp directory;  4) I remove all tables from the Alfresco Mysql database, leaving the database and permissions for the alfresco user in place; 5) I create an empty alf_data directory for the upgrade.

Then I do the upgrade steps.  I can log into 4.0b fine at this point.

To restore I do these steps: 1) Making sure the Alfresco App is stopped, I delete all the tables that were created in the Mysql database during the upgrade.  Then I run the command "mysql –verbose –user=alfresco –password=<pw> alfresco_database < alfresco_bkup.sql";  2) To restore the repository, I delete the entire alf_data directory that was created during the upgrade and copy my backed up copy of the alf_data directory back into place.  3) I start the app, but things are now broken.

I can go into Mysql and see the restored tables and data and I can go to the alf_data directory and see data in contentstore, etc.

Should I be doing my restore differently?  Any suggestions would be much appreciated.
9 REPLIES 9

nickbsd
Champ in-the-making
Champ in-the-making
If you ever find a solution please let me know.

I've have multiple posts here on the forum and I haven't figured it out and it's driving me crazy! The problem is, our 3.4c is actually in full-fledge production so I have to figure it out in order to rollup to the next release.

Thanks!  :roll:

digihorse
Champ in-the-making
Champ in-the-making
My experience was this:   You can not directly update from 3.4d to 4.0b.  It will fail. Even with the patch.  I spent about 4 days trying with every possible solution offered.  The only solution that worked was to go 3.4d, to 4.0a, fix those problems and then update to 4.0b.   This was with OpenSuSE and MySQL.  Steps are as follows:
1. Stop the 3.4 system.  Make a copy of the install folder.  THat will take a little bit.  Notice I copy the ENTIRE install of alfresco. Not just the alf-data folder.  This is to ensure that I have a complete, unpolluted copy of a functioning system.  That will not be true if you only do the alf_data.  Its very simple to roll this back to the current production system with this method.
2. Do a dump of the mysql database.  Create a new version of the database for going forward, in my case alfresco4 with the same connection info.
3. replace the war files for ALL of the apps, alfresco, share, wcmqs and awe.  I usually delete the folders as well. They will be recreated when the wars are redeployed. Make sure you save any custom configs you have in those folders.
4. Make sure in install the wcmqs and any other updated amps files in the amps folder.
5. Edit the alfresco-global.properties file to reflect the updated database name.
5. Start Alfresco and cross your fingers.

Now, it does take a while for the system to run the upgrade. Many many minutes. It may actually come "online" and you be able to login, and yet, it will not have finished the process, which will be evident but the fact you will have empty folders.Don't panic yet. Keep watching the logs, as you will see the system is still running the update.  Further, I had to kick mine a second time to get it to complete. I had many empty folders left after the first pass.  After a couple of hours, it finally did complete, and all content was available, except, one folder. See my post on "upgrade caution".  

Once this was finished, then the upgrade to 4.0b was cake and went without a hitch using the same method. So far the upgrade to 4.0c on the dev system has also been clean.  Lastly, I suggest you setup a least a VM with a duplicate of your OS setup. Make sure it is exact.  Make a copy of your alfresco install to this system, and practice the update there.  Once you have been through it several times, you will see and understand where the bugs are for your setup, and have arrived at a solution that will ensure the least amount of pain when you finally upgrade your production server.

Hope this helps.

nickbsd
Champ in-the-making
Champ in-the-making
First off, let me say thank you for taking time out of your day to help me.

I've followed the steps below but Alfresco fails to start which appears to be because the mysql db is not updating.

A. Stopped the Alfresco and Share application(s) in the Tomcat manager.
B. tarred up the alfresco|tomcat installation
  tar cvf \root\alfresco3.4c.tar.gz \usr\local\tomcat\
C. created a mysql_dump of the current database
  mysqldump -u root -p –default-character-set=latin1 -N alfresco > backup.sql
D. deleted all of the alfresco and share folders and WAR data as instructed in the 'webapps' folder.
E. uploaded new 4.0a Share and Alfresco war files
F. edited alfresco-global.properties located in \usr\local\tomcat\shared\classes\alfresco-global.properties to reflect a new mysql database name (empty)
G. attempted to start the Alfresco and Share WAR in the Tomcat manager.

I noticed on step 4 you mentioned to install the wcmqs application. I'm not sure how to do this. In the current environment, I'm only using Share and Alfresco WAR files.

SEVERE Warnings in \usr\local\tomcat\logs\stdout.log

SEVERE: problem during schema upgrade, statement 'alter table ACT_RU_TASK
add OWNER_ varchar(64)
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate column name 'OWNER_'



1. Stop the 3.4 system. Make a copy of the install folder. THat will take a little bit. Notice I copy the ENTIRE install of alfresco. Not just the alf-data folder. This is to ensure that I have a complete, unpolluted copy of a functioning system. That will not be true if you only do the alf_data. Its very simple to roll this back to the current production system with this method.
2. Do a dump of the mysql database. Create a new version of the database for going forward, in my case alfresco4 with the same connection info.
3. replace the war files for ALL of the apps, alfresco, share, wcmqs and awe. I usually delete the folders as well. They will be recreated when the wars are redeployed. Make sure you save any custom configs you have in those folders.
4. Make sure in install the wcmqs and any other updated amps files in the amps folder.
5. Edit the alfresco-global.properties file to reflect the updated database name.
5. Start Alfresco and cross your fingers.

Now, it does take a while for the system to run the upgrade. Many many minutes. It may actually come "online" and you be able to login, and yet, it will not have finished the process, which will be evident but the fact you will have empty folders.Don't panic yet. Keep watching the logs, as you will see the system is still running the update. Further, I had to kick mine a second time to get it to complete. I had many empty folders left after the first pass. After a couple of hours, it finally did complete, and all content was available, except, one folder. See my post on "upgrade caution".

Once this was finished, then the upgrade to 4.0b was cake and went without a hitch using the same method. So far the upgrade to 4.0c on the dev system has also been clean. Lastly, I suggest you setup a least a VM with a duplicate of your OS setup. Make sure it is exact. Make a copy of your alfresco install to this system, and practice the update there. Once you have been through it several times, you will see and understand where the bugs are for your setup, and have arrived at a solution that will ensure the least amount of pain when you finally upgrade your production server.

digihorse
Champ in-the-making
Champ in-the-making
yes… I ran into that problem too. The update will NOT update an empty database, even though there are wiki/forum post that say it will. Fail!

I use the dump to create the new database.  Didn't write that well did I? Sorry.  So I create the database alfresco4 and dump the data backup into it. so it is a complete copy of the 3.4d database, with a different name.  This is the database that gets updated.  Hope that makes more sense. Sorry for the confusion.

Re: wcqms and awe are wars that may have been installed on your 3.4d.  If they were not, don't worry about it. I installed everything, and so so had them, and had to upgrade them as well. Its the Web Quick Start.

nickbsd
Champ in-the-making
Champ in-the-making
I took my original backup.sql and restored it to new database 'alfresco4'. Prior to restoring I made sure the database was empty. After I restored the database– mysql -u alfresco -p alfresco4 < \root\alfdev-bk.1.12.12\backup.sql – i verified the database contained table information. I then restarted tomcat and alfresco still fails to start. I've posted the error information from alfresco.log


12:29:32,001 INFO  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] Starting 'sysAdmin' subsystem, ID: [sysAdmin, default]
12:29:32,070 INFO  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] Startup of 'sysAdmin' subsystem, ID: [sysAdmin, default] complete
12:29:37,213 WARN  [org.springframework.core.io.support.PathMatchingResourcePatternResolver] Skipping [/usr/local/apache-tomcat-6.0/shared/classes/alfresco/extension/subsystems/Authentication/alfrescoNtlm/alfrescoNtlm1] because it does not denote a directory
12:29:46,695 INFO  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] Stopping 'sysAdmin' subsystem, ID: [sysAdmin, default]
12:29:46,695 INFO  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] Stopped 'sysAdmin' subsystem, ID: [sysAdmin, default]
12:29:46,700 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activitiParseListener' defined in class path resource [alfresco/activiti-context.xml]: Cannot resolve reference to bean 'activitiCreateTaskListener' while setting bean property 'createTaskListener'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activitiWorkflowManager' defined in class path resource [alfresco/activiti-context.xml]: Cannot resolve reference to bean 'activitiProcessEngine' while setting bean property 'processEngine'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activitiProcessEngine': FactoryBean threw exception on object creation; nested exception is org.activiti.engine.ActivitiException: couldn't upgrade db schema: alter table ACT_RU_TASK
add OWNER_ varchar(64)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
        at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1276)
        at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:625)
        at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:136)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:186)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activitiWorkflowManager' defined in class path resource [alfresco/activiti-context.xml]: Cannot resolve reference to bean 'activitiProcessEngine' while setting bean property 'processEngine'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activitiProcessEngine': FactoryBean threw exception on object creation; nested exception is org.activiti.engine.ActivitiException: couldn't upgrade db schema: alter table ACT_RU_TASK
add OWNER_ varchar(64)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:281)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
        … 39 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activitiProcessEngine': FactoryBean threw exception on object creation; nested exception is org.activiti.engine.ActivitiException: couldn't upgrade db schema: alter table ACT_RU_TASK
add OWNER_ varchar(64)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1429)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
        … 51 more
Caused by: org.activiti.engine.ActivitiException: couldn't upgrade db schema: alter table ACT_RU_TASK
add OWNER_ varchar(64)
        at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:832)
        at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:760)
        at org.activiti.engine.impl.db.DbSqlSession.dbSchemaUpgrade(DbSqlSession.java:739)
        at org.activiti.engine.impl.db.DbSqlSession.dbSchemaUpdate(DbSqlSession.java:656)
        at org.activiti.engine.impl.db.DbSqlSession.performSchemaOperationsProcessEngineBuild(DbSqlSession.java:901)
        at org.activiti.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:33)
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
        at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
        at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:80)
        at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:282)
        at org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:60)
        at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:56)
        at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
        … 56 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate column name 'OWNER_'
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
        at com.mysql.jdbc.Util.getInstance(Util.java:384)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2562)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2512)
        at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:781)
        at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:624)
        at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
        at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
        at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
        at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:806)
        … 73 more



Can I get a peak at your alfresco-global.properties file? I'm forcing a schema update in my alfresco file but it doesn't appear to be taking.
– db.schema.update=true

digihorse
Champ in-the-making
Champ in-the-making
If you read your log, you are missing that you have components/modules enabled that are not loading. Just posting this quickly…. but it seems like you are focusing on the database, when its not the problem. Take another look at the log, and get each of those errors to go away or at least understand why that error is there and its consequences.

nickbsd
Champ in-the-making
Champ in-the-making
That sounds like a good place to start. I didn't know if the DB problems were related..

Oh and thanks for the feedback! I'll post a response once I make some progress.

Thanks

nickbsd
Champ in-the-making
Champ in-the-making
Can you post your alfresco-global config? I'm still not able to upgrade the database schema yet all the permissions are set in MySQL.

So far, I've successfully upgraded from 3.4.D to 3.4.E and now I'm attempting an upgrade to 4.0.a.

Thanks!