AnsweredAssumed Answered

Error creating versions

Question asked by ranjeetsi on Aug 17, 2018
Latest reply on Sep 28, 2018 by hiten.rastogi

For our custom project - (Using Alfresco 5.2.3)

Have a requirement to export all the versions of the document and then import at another repository.
Exports are fine but when we tried to import with all the versions, it is failing. 
For Eg. 
if the exported content has 3 versions (v1, v2 and v3). During import process we are trying to create base version node and then creating node for all other versions. while 
creating base node that is v1, it was created successfully. while creating node for v2, we are getting below error.
Error:
org.alfresco.service.cmr.version.VersionServiceException: 07129796 The current version label of the node does not exist in the version history.
Exception :
org.alfresco.service.cmr.version.VersionServiceException: 07129796 The current version label of the node does not exist in the version history.      at org.alfresco.repo.version.Version2ServiceImpl.createVersion(Version2ServiceImpl.java:267)      at org.alfresco.repo.version.Version2ServiceImpl.createVersion_aroundBody2(Version2ServiceImpl.java:141)      at org.alfresco.repo.version.Version2ServiceImpl$AjcClosure3.run(Version2ServiceImpl.java:1)


Code from where it fails:

Map<String, Serializable> versionProperties = new HashMap<String, Serializable> ();
versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MAJOR);
versionProperties.put(Version.PROP_DESCRIPTION,"versioned");
versionService.createVersion(baseNode, versionProperties) ;

Outcomes