cancel
Showing results for 
Search instead for 
Did you mean: 

Restoring Solr indexes

baikal
Champ in-the-making
Champ in-the-making

I'm a bit confused with backing up and restoring Solr indexes. When I'm backing up alfresco do I need to copy both solr4 and solr4backup directories? Then what do I need solr4backup for? Can I restore indexes from just solr4backup and if so, how do I do that? Solr4backup and solr  have different layouts. 

4 REPLIES 4

afaust
Legendary Innovator
Legendary Innovator

The SOLR index and backup indices should not have that different of layouts. There are just one or two more layers in the backup directory to manage multiple snapshots (backups from different dates). You should only ever use the backup folder in your custom backup scripts when Alfresco is running. Only if Alfresco (and SOLR) are stopped can you safely backup the actual index folder (in that case there is no need for the backup folder).

A backup can simply be restored by copying the data folders of the index snapshot you want back into the actual index folder while SOLR is stopped and start SOLR. It will then track and index any changes that have occurred since the snapshot was created.

baikal
Champ in-the-making
Champ in-the-making

Thanks for reply! I'll check layout again, probably I've just got lost.) One more related question: my dir_root directory points to an old installation dir.root=/opt/alfresco-5.0.d/alf_data, yet I have my solr indexes in a new installation folder /opt/alfresco-community/alf_data/solr4  and solr4backup in /opt/alfresco-5.0.d/alf_data/solr4Backup (where it should be). Is there a way to put solr indexes in old root directory, where solr4Backup lies

afaust
Legendary Innovator
Legendary Innovator

Yes - simply stop SOLR, change configuration in solrcore.properties for each SOLR core, move the folders and restart.

cesarista
World-Class Innovator
World-Class Innovator

Hi:

In addition to Axel Faust comment, changing SOLR indices location involves changing data.dir.root property in solrcore.properties for each core. But there are other directories under $ALF_HOME/alf_data/solr4 (content and model directories), whose locations are set in $ALF_HOME/tomcat/conf/Catalina/localhost/solr4.xml

Regards.

--C.