Skip to content

AEM Cold Backup


This is just a custom guide to run cold backup on AEM Author/Publish instance  on remote windows server, this could be more technical and advanced guide, if you do not understand or don’t know what you are doing, I kindly request you to take extreme caution. The components used here are billable. SKYDEVOPS/I/WE do not take any responsibility if the guide causes any serious damage or issues, which you have to take full responsibility.

Step-01: Create a Free style Job on Jenkins

Screen Shot 2018-05-03 at 3.05.26 PM

Step-02: Setup a parameterised build job, create a string parameter for remote Host

Screen Shot 2018-05-03 at 3.07.01 PM

Step-03: Setup a string parameter for remote User

Screen Shot 2018-05-03 at 3.33.27 PM

Step-04: Setup a String parameter for Remote User Password

Screen Shot 2018-05-03 at 3.34.21 PM

Step-05: Create a Powershell script to run cold backup on  AEM

[code lang=powershell]

# stopping the job if it encounters error
$ErrorActionPreference = ‘Stop’

# Credentials are stored in env and dynamic variables
$SecurePassword = $env:Password | ConvertTo-SecureString -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential -ArgumentList $env:User, $SecurePassword


# Invoke a command on the remote machine.
Invoke-Command -ComputerName $env:Computer -Credential $cred -ScriptBlock {
Stop-Service -Name AEM6A

cd C:\Users\SKYDEVOPS\Desktop\AEM\Author\crx-quickstart
$fName=(Get-Item -Path “.\”).Parent.BaseName

compress-archive -Path C:\Users\SKYDEVOPS\Desktop\AEM\Author\crx-quickstart -CompressionLevel optimal -DestinationPath “C:\Users\SKYDEVOPS\Desktop\backups\$(get-date -f yyyy-MM-dd-hhmmss)_$”

Start-Service -Name AEM6A


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.