problem: We did a server migration a few months ago and page versions and audit history was not copied across.
------------
what I want/what I'm trying to do:
- I want to copy page versions and audit history from a prod backup (taken before server migration) to existing prod author
- I want to limit the data to anything that happened before 2023-Mar-01.
- I do not want to overwrite the existing content with the old content. If a page has more recent updates (made after 2023-Mar-01) than the backup, then these updates must be retained.
-------
what I've tried so far
1st command I've tried:
java -Xmx4g -jar ./crx2oak-1.10.0-all-in-one.jar \
/home/ec2-user/prod-efs /opt/aem/author/crx-quickstart/repository \
--copy-orphaned-versions=false --copy-versions=2023-03-07 \
--include-paths=/content/brand1,/content/brand2 \
--merge-paths=/content/brand1,/content/brand2
The problem with the command above is that it has overwritten my destination.
Before I ran the command, I checked QueryBuilder how many pages have been edited since 2023-Aug-01 and I got 65 pages. After running the command, I only got 21 pages on QueryBuilder.
As a an example of the overwriting problem, the cq:lastModified property of a page has changed. Before running the command, the cq:lastModified was 2023-Aug-02. After running the command, the cq:lastModified is now 2023-Feb-23.
-----
2nd command I've tried:
java -Xmx4g -jar ./crx2oak-1.10.0-all-in-one.jar \
/home/ec2-user/prod-efs /opt/aem/author/crx-quickstart/repository \
--copy-orphaned-versions=false --copy-versions=2023-03-07 \
--include-paths=/jcr:system/jcr:versionStorage,/var/audit/com.day.cq.wcm.core.page \
--merge-paths=/jcr:system/jcr:versionStorage,/var/audit/com.day.cq.wcm.core.page
But somehow my audit history got messed up. Before running the 2nd command, I can see page history in /sites.html Timeline feature. After running 2nd command, Timeline is now empty.
![2023-08-28 11_26_36.png 2023-08-28 11_26_36.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/62005iE63D714B473B4A16/image-size/small?v=v2&px=200)
![2023-08-28 11_20_39.png 2023-08-28 11_20_39.png](https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/62006i33E2BBCECAE33744/image-size/small?v=v2&px=200)