Backup And Restore
Backup is required for following reason:
- Reliability: In case other system goes down, You should have other instance to fall back to.
- Disaster Recovery: In case of disaster you should have a backup system to restore from.
Taking CQ Backup:
There are two three type of backup mechanism available in CQ
- Offline backup
- Online Backup
- Hybrid Backup
Offline backup is as simple as taking snapshot backup of your file system. For this do following
- Stop Tour CQ instance
- Take Snapshot backup of your file system (crx-quickstart folder)
- Start CQ Instance
CQ provide feature of taking backup of your system while system is running. You can do this by UI.
Using CQ UI:
- Login in to CQ as admin user
- Click on Backup Or go to <HOST>:<PORT>/libs/granite/backup/content/admin.html
- Enter information and click on start backup
OR Using CRX UI:
- You can also start backup using crx explorer. Go to crx explorer <HOST>:<PORT>/crx/explorer/index.jsp
- Click on repository configuration
- Click on backup repository
- Then select your option
- Click on start backup and enter appropriate value
OR Using curl command:
- curl -u admin:<ADMIN PASSWORD> -X POST http://<HOST>:<PORT>/system/console/jmx/com.adobe.granite:type=Repository/op/startBackup/java.lang.String?target=<TARGET PATH WITH ZIP FILE NAME>
Hybrid backup is combination of offline and online backup. In this you separate some folder from crx-quckstart folder and take backup of them separate. When CRX writes are happening tar files in file systems are locked, Thats why it is not a good idea to take a file system backup when system is running. However part of repository like "datastore" do not get locked during this process. Also in CQ datastore holds large binaries and hence it's size is biggest. If you are planning for Hybrid backup you have to follow following steps:
- Separate Datastore from repository and reference new location in crx-quickstart/repository/repository.xml. You can also separate logs folder if you want and create soft link for that.
Separate DataStore in CQ
<param name="path" value="<YOUR NEW PATH>"/>
- Then take online backup of your repository using UI not including datastore folder.
- You can take backup of datastore using tool like rsync.
Restoring CQ Backup:
- If backup is taken offline then just replace file system view of backup
- If backup is taken online then use command jar -xvf <your backup zip file name> to restore.
- If you have taken hybrid backup then restore one part using file system view and other part as jar -xvf <your backup zip file name>
Detail information about taking and restoring CQ backup can be found from here