Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Powershell Export content using FileVault
# Download and extract Filevault from https://github.com/aem-design/jackrabbit-filevault/releases run this in the extracted folder.
#equivalent of using localhost in docker container
Set-Variable -name SOURCE_HOST -value "localhost"
# TCP port SOURCE_CQ listens on
Set-Variable -name SOURCE_PORT -value "4502"
# AEM Admin user for SOURCE_HOST
Set-Variable -name SOURCE_AEM_USER -value "admin"
# AEM Admin password for SOURCE_HOST
Set-Variable -name SOURCE_AEM_PASSWORD -value "admin"
# Root folder name for placing content
Set-Variable -name SOURCE_CONTENT_FOLDER -value "localhost-author-export"
Set-Variable -name SCHEMA -value "http"
#to set additional flags if required
Set-Variable -name VLT_FLAGS -value "--insecure"
Set-Variable -name VLT_CMD -value "./bin/vlt"
Set-Variable -name ROOT_PATH -value "/content"
Set-Variable -name CONTENT_DESTINATION -value "./content"
echo ------- CONFIG ----------
echo "SCHEMA: $SCHEMA"
echo "SOURCE_HOST: $SOURCE_HOST"
echo "SOURCE_PORT: $SOURCE_PORT"
echo "SOURCE_AEM_USER: $SOURCE_AEM_USER"
echo "CONTENT_DESTINATION: $CONTENT_DESTINATION"
echo "VLT_FLAGS: $VLT_FLAGS"
echo "VLT_CMD: $VLT_CMD"
echo ------- START Exporting content ----------
echo ${VLT_CMD} ${VLT_FLAGS} --credentials ${SOURCE_AEM_USER}:****** export -v ${SCHEMA}://${SOURCE_HOST}:${SOURCE_PORT}/crx/-/jcr:root ${CONTENT_DESTINATION}
Invoke-Expression -Command "${VLT_CMD} ${VLT_FLAGS} --credentials ${SOURCE_AEM_USER}:${SOURCE_AEM_PASSWORD} export -v ${SCHEMA}://${SOURCE_HOST}:${SOURCE_PORT}/crx/-/jcr:root${ROOT_PATH} ${CONTENT_DESTINATION}"
echo ------- END Exporting content ----------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment