Monday, November 14, 2011

How to mount DataStore in different directory in CQ / WEM

Use Case : You have huge datastore and want to mount it on different directory Or Online backup takes a lot of time including datastore and you want to do separate backup for datastore

Solution : Here is process for how to separate Datastore and then do separate online backup

Assuming your repository is under /mnt/crx/repository and you want to move your datastore to /mnt/crx/datastore

1. stop the crx instance
2. mv /mnt/crx/repository/shared/repository/datastore /mnt/crx/
3. Then modify repository.xml by adding the new path configuration to the DataStore element.

<DataStore class="">
<param name="minRecordLength" value="4096"/>

<DataStore class="">
<param name="path" value="/mnt/crx/datastore"/>
<param name="minRecordLength" value="4096"/>

4. Start CRX

After doing this then you can safely run separate backups on the datastore while the system is running without affecting performance very much.

Following our example, you could use this command to backup the datstore:
rsync --av --ignore-existing /mnt/crx/datastore /mnt/backup/datastore

Information about rsync can be found here


  1. If we mount datastore in different directory outside repository , definitely online back up time will improve , but what about search? How will it impact asset search within the repository?

    1. Hello,

      It will not effect asset search at all. Search information for asset is stored as index (Lucene) under /repository/repository/index