Go to http://src-aem-host:port/crx/packmgr/index.jsp and log in as admin.
Environment
AEM 6.x
Steps
The instructions below must be run on Mac OS, Linux, or Windows (on Cygwin) with cURL, Python and Java SDK installed:
-
-
Create a package named "ACL-migration"
-
Click the Edit button.
-
Select the Advanced tab and set AC Handling mode to Merge.
-
Save.
-
Build the package and download it.
-
On the file system run this command on the package to extract the META-INF/vault/filter.xml file:
jar -xvf ACL-migration-1.0.zip META-INF/vault/filter.xml
-
In the same directory, run this command to download a json file of the ACL paths from the source instance. Set the username and password and correct host and replace the xpath query /jcr:root/content//element(*,rep:ACL) with your own):
curl -u admin:admin 'http://aemhost/crx/de/query.jsp?' -G --data '_dc=1507011481908&_charset_=utf-8&type=xpath&stmt=/jcr:root/content//element(*,rep:ACL)&showResults=true' > data.json
-
Create a file generate-package-filter.py and paste the python code below inside it:
-
Run the python script from the same folder where data.json was created and save the output to META-INF/vault/filter.xml (replacing the existing contents of filter.xml):
python generate-packge-filter.py > META-INF/vault/filter.xml
import json from pprint import pprint with open('data.json') as data_file: data = json.load(data_file) print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>") print("<workspaceFilter version=\"1.0\">") for item in data["results"]: print("<filter root=\"{}\"/>".format(item["path"])) print("</workspaceFilter>")
-
Use this command to update the filter.xml within the zip file:
jar -uvf ACL-migration-1.0.zip META-INF/vault/filter.xml
-
Upload the zip file to the source instance package manager: http://src-aem-host:port/crx/packmgr/index.jsp
-
Click Build or Rebuild to build the package.
-
Download the package from the source AEM server.
-
Upload the package to the destination AEM server's package manager: http://dst-aem-host:port/crx/packmgr/index.jsp
-
Click Install to install it.