Affects Version/s: 1.8.17, 1.10.6
Fix Version/s: None
This improvement request relates to oak-upgrade in combination with using the --merge-paths flag.
A merge will fail if the new repository already has a copy of the old repository and a node at the source has been renamed. The renamed node would be copied over to the destination repository which contains the node with the original name. Both share the same UUID and the content merge will fail with an OakConstraint0030.
Here is a use case:
- Production System: „/content/example“ is created.
- Production System is copied over prior to migration to Staging System.
- Production System: "/content/example" is renamed to "/content/example-backup".
- Production System: "/content/example" is created with different content to before.
- java -jar crx2oak.jar --copy-binaries --src-datastore=/source/datastore --datastore=/destination/datastore \
--include-paths=/content --merge-paths=/content \
oak-upgrade fails with this message:
Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: OakConstraint0030: Uniqueness constraint violated property [jcr:uuid] having value 12345678-1234-1234-1234-123456789012: /content/example-backup, /content/example
Option 1: If there are duplicate UUIDs, oak-upgrade should assume a rename so already existing destination nodes should be dropped and the new one copied.
Option 2: If there are duplicate UUIDs, oak-upgrade should assume a rename so already existing destination nodes should be versioned and dropped and the new one copied.
Flags --copy-orphaned-versions and --copy-versions should be respected.