I have two node, old and new version. I want to copy the properties from the old to the new without damaging the version information.Now I do so:
Map<String, Serializable> properties = new HashMap<String, Serializable>();
properties.put(VersionModel.PROP_VERSION_TYPE,VersionType.MAJOR);
getServiceRegistry().getVersionService().createVersion(oldTestNodeRef, properties);
getServiceRegistry().getNodeService().setProperties(oldTestNodeRef, getServiceRegistry().getNodeService().getProperties(testNodeRef));
as a result I overwrites the properties and version information.And when you try to create a new version get an error "The current version label of the node does not exist in the version history."