cancel
Showing results for 
Search instead for 
Did you mean: 

Need advice about backup/restore

zomurn
Champ in-the-making
Champ in-the-making
Hello,

I'am was wondering how to proceed for backup/restore of the server in this scenario:

1) The production version is working well.
2) I backup the production version
3) 1 week later, I update the custom model into which I add more metadata. Hence, I apply the default new metadata values to all documents in production.
4) The application in production crash…I need to do restore from step 2).
….
Documents in production have the new metadata which are not present anymore in the model due to restore….how to deal with this scenario ??

Help me please
23 REPLIES 23

derek
Star Contributor
Star Contributor
I forgot to mention, that you can try the following:
    Add a file to Alfresco
    Take a backup of the DB
    Modify the file in Alfresco
    Restore the DB
    Check that the content was "restored" as well.

zomurn
Champ in-the-making
Champ in-the-making
Is it "avmOrphanReaperJob" in scheduled-jobs-context to set to 7 days for parameter "repeatIntervalMinutes" or "protectDays" in content-services-context.
For example, I crashed my dev post right now and alfresco refuse to start…only by recompiling my jar file (edited the java code only and .xml spring beans file) and I'd like to simulate what to do if it happens like in prod without knowing why it crashes…what do you suggest to fix the problem of "a previous schema upgrade failed…"

Thanks

derek
Star Contributor
Star Contributor
It's protectDays (as per Wiki page referenced).

If your system crashes during install or upgrade, then you need to reset or restore your DB and start again.  Clearly, Alfresco can't start up on a half-baked schema.

I repeat: You should not be modifying your config within the jar files.  Use the proper override mechanisms.

zomurn
Champ in-the-making
Champ in-the-making
But inside my jar file. The only xml files are spring beans and the module-context.xml which import only these xml spring files.
My model is kept in alfresco/classes/extension in the WEB-INF directory (the WEBAPP).
Honestly, I really didn't know why my post has crashed…I restored a previous version db+alf_data and all was recovered.

derek
Star Contributor
Star Contributor
Well, the "crash" would have to be investigated separately (you could post more details).  Do you want to know more about the backup strategy?

zomurn
Champ in-the-making
Champ in-the-making
Of course I want  Smiley Happy … even if my customer do a copy/paste each day on a backup server.
Otherwise, another time, this morning, I start my computer and run my tests one more time….I have got for the first time on my test repository "A previous schema upgrade failed" where as I only code test and run them on it. I really don't understand why my repository has crashed.

Whole stack trace :

10:06:12,817 INFO  [alfresco.mbeans.VirtServerRegistry] Creating VirtServerRegistry MBean
10:06:13,863 WARN  [remoting.rmi.RmiRegistryFactoryBean] Could not detect RMI registry - creating new one
10:06:14,114 INFO  [alfresco.mbeans.VirtServerRegistry] Created JMX serverConnector
10:06:14,161 DEBUG [alfresco.module.msc] preRegister called. Server=com.sun.jmx.mbeanserver.JmxMBeanServer@1f784d7, name=log4j:logger=org.alfresco.module.msc
10:06:16,501 INFO  [domain.schema.SchemaBootstrap] Schema managed by database dialect org.hibernate.dialect.MySQLInnoDBDialect.
10:07:16,624 ERROR [domain.schema.SchemaBootstrap] Schema auto-update failed
org.alfresco.error.AlfrescoRuntimeException: A previous schema upgrade failed.  Revert to the original database before attempting the upgrade again.
   at org.alfresco.error.AlfrescoRuntimeException.create(AlfrescoRuntimeException.java:46)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.setBootstrapStarted(SchemaBootstrap.java:510)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:949)
   at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
   at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
   at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:241)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:349)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
   at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
   at org.alfresco.module.msc.common.test.MscAbstractTestCase.<clinit>(MscAbstractTestCase.java:36)
   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:494)
   at junit.framework.TestSuite.createTest(TestSuite.java:131)
   at junit.framework.TestSuite.addTestMethod(TestSuite.java:114)
   at junit.framework.TestSuite.<init>(TestSuite.java:75)
   at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102)
   at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
java.lang.ExceptionInInitializerError
   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:494)
   at junit.framework.TestSuite.createTest(TestSuite.java:131)
   at junit.framework.TestSuite.addTestMethod(TestSuite.java:114)
   at junit.framework.TestSuite.<init>(TestSuite.java:75)
   at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102)
   at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.alfresco.error.AlfrescoRuntimeException: Schema auto-update failed
   at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:1002)
   at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
   at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
   at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:241)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:349)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
   at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
   at org.alfresco.module.msc.common.test.MscAbstractTestCase.<clinit>(MscAbstractTestCase.java:36)
   … 13 more
Caused by: org.alfresco.error.AlfrescoRuntimeException: A previous schema upgrade failed.  Revert to the original database before attempting the upgrade again.
   at org.alfresco.error.AlfrescoRuntimeException.create(AlfrescoRuntimeException.java:46)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.setBootstrapStarted(SchemaBootstrap.java:510)
   at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:949)
   … 23 more

derek
Star Contributor
Star Contributor
Hi,
Revert to the original database before attempting the upgrade again.
At some or other point, you attempted an upgrade (or installation) that either failed or was terminated midway.  You need to revert to a good copy of the data.  You will not be able to recover the server with any confidence.  When you upgrade Alfresco, you should be prepared to have schema updates applied and have the appropriate backups beforehand.
Regards

archana_bonkanp
Champ in-the-making
Champ in-the-making
Hi,

I have some doubts related to backup and recovery.
We are taking the backup of Alfresco application daily.
the steps followed are
1)we will stop the server
2)take the db backup
3)take the alf_data backup
4)then restart the server

but its taking lot of time in hours.
can you olease suggest us any other means of taking backup,since restoratin is also taking huge amount of time.

derek
Star Contributor
Star Contributor
Hi,
You can do a hot backup i.e. backup with the system still running.
1. Wait until the lucene index backup is done i.e. set that to happen a bit before your backup starts
2. Do a transactionally-safe backup of the DB
3. Backup the content (content stores and backup lucene indexes).  NOT the live Lucene indexes.
4. Clean out the contentstore.deleted

Restoring your DB and Lucene indexes is one thing, but you will need to run the system with index.recovery.mode=AUTO as (you may have spotted it) the Lucene indexes could be out of date.

The contentstore is partitioned by date ranges.  You can, if you already have year 2008 backed up, for example, only backup current 2009.

archana_bonkanp
Champ in-the-making
Champ in-the-making
Hi,

The content is stored datewise only (2007,2008,2009).
but if any user deletes the data which is uploaded in 2008 and if i dont take 2008 bckup then there will not be no problem right.