Expand my Community achievements bar.

How to export and install content with version history

Avatar

Level 1

I have a case where I need to backup a content (site pages) including their versions, so to we can an any time on any instance restore the content with their versions. Content is on AEMaaCS, restore activity can be and doesn't need to be on AEMaaCS.

Seems crx2oak could support this, but we can't use it due to AEMaaCS.

 

We tried to create a package with content and versions /jcr:system/jcr:versionStorage/*. Can be exported, but can't be installed on other instance, due to different errors, based on how we export versions (e.g versionStorage root VS versionHistory of the page VS only specific version of the page )

 

First error was org.apache.jackrabbit.vault.packaging.PackageException: Error creating/updating node /jcr:system/jcr:versionStorage/8e/90/dd/8e90dd8e-b13b-4d44-83a1-ea6c8498d3be. Caused by javax.jcr.nodetype.ConstraintViolationException: /content/test/main/en/archive/jcr:content/jcr:versionHistory is protected 
First error was org.apache.jackrabbit.vault.packaging.PackageException: Error creating/updating node /jcr:system/jcr:versionStorage/ff/70/d2/ff70d273-1a75-4eb4-86df-75389ee5abd9/1.0. Caused by javax.jcr.PathNotFoundException: 1.0 
 
Also I'm aware of VersionManger and VersionHistory API.
 
I'm wondering is it possible to somehow programmatically achieve this or any different way?
 
Thanks.
3 Replies

Avatar

Community Advisor

Hi @matija_kovacek ,

 

I dont think it is possible in aem cloud.

Avatar

Level 1

What would be possibilities on non cloud version?

Avatar

Community Advisor

For Non cloud, like you said CRX2OAK is the option. Used in AMS/On Prem set up for transferring with version.