cancel
Showing results for 
Search instead for 
Did you mean: 

Lost version history when update file properties

TomasHorvath
Champ in-the-making
Champ in-the-making

Hi guy , I apologize I am really alfresco newbie. I try to update file properties with REST API. But allways I lost all version history. I cannot find any parametr in swagger which can help me. 

1 REPLY 1

abhinavmishra14
World-Class Innovator
World-Class Innovator

With the info you have shared, it could be possible that you are not using the APIs properly and somehow cm:versiobable aspect is getting removed. Could you check whether cm:versionable aspect is present on the document where you are seeing this issue? you can use node browser to check that or use below api call with nodeRefId param:

This would return a list of aspects in the response, you can check cm:versionable aspect presence:

http://127.0.0.1:8080/alfresco/service/api/metadata?nodeRef=workspace://SpacesStore/902413b5-b3ed-4a88-afed-6b44f88a78d5

Also can you make sure there are no change to following properties, these are default settings:

# ADM VersionStore Configuration 
version.store.initialVersion=true version.store.enableAutoVersioning=true version.store.enableAutoVersionOnUpdateProps=false

If you want  a new version to be created on update of one/more properties, you can enable it in alfresco-global.properties:

version.store.enableAutoVersionOnUpdateProps=true

To understand more on how these properties work, refer this post: https://hub.alfresco.com/t5/alfresco-content-services-forum/version-history-does-not-include-propert...

Have a look at these V1 REST APIs:

To upload a file: https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-upload-file.html

To upload a new version of a file: https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-upload-file-new-version.html

To update the properties: https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-update-node-metadata.html

Just follow the instructions and try the sample URLs as provided to under the working of APIs.

All file/folder management APIs can be found here: https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-mng-folders-files.html

~Abhinav
(ACSCE, AWS SAA, Azure Admin)