Skip to content

Instantly share code, notes, and snippets.

@ksurendra
Created May 16, 2018 14:59
Show Gist options
  • Save ksurendra/01baf4d771576bc0795489eb2a45372f to your computer and use it in GitHub Desktop.
Save ksurendra/01baf4d771576bc0795489eb2a45372f to your computer and use it in GitHub Desktop.
vlt export command script and filter.xml using the same destination folder on adobe experience manager (aem)
<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
<filter root="/content">
<exclude pattern="/content/jcr:system"/>
<exclude pattern="/content/var/classes"/>
<exclude pattern="^.*/rep:accessControl"/>
</filter>
</workspaceFilter>
#!/bin/bash
# This script is used to export the contents from AEM CRX to an external folder.
# $1 - Source path from where the files need to be copied from
# $2 - Destination path where the files need to be copied to
#
# Step 1 - Make sure the vault-cli sources are in path
export PATH=$PATH:/Users/Software/vault-cli-3.1.16/bin
#
# Step 2 - vlt overwrites/creates the filter.xml with the source path. We need this to be removed as consecutive exports will not work if the path is not set to the source. To avoid this we remove the filter.xml and copy a file that has /content as the root so any export will work.
echo $'***Resetting filter.xml for the export...'
rm -f $2/META-INF/vault/filter.xml
cp -f /Users/temp/data/filter.xml $2/META-INF/vault
echo $'***Completed resetting filter.xml'
#
# Step 3
echo $'***Starting to execute vlt command...'
vlt --credentials admin:admin export -v http://localhost:4502/crx $1 $2
echo $'***Completed vlt command successfully'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment