Using Version Control
The process of creating a document often involves creating many updates of a file. During the process one may want to go back and use something from a previous version that has been deleted. Using version control makes reverting to a particular point in time easy. It is used by teams and individuals from the software development, graphic design, writing and editing sectors.
Version control can also be used as a backup server. If someone deletes a file by accident it is easy to recover it. ownCloud has included this feature, namely the Deleted files button.
Files that are deleted in ownCloud are moved to a trash bin folder.
Here one can 'undo' the deletion of a file by clicking on Restore.
In addition one can delete a file permanently by clicking on the X. This is something to keep in mind when you are running out of available space. By default, deleted files stay in the trash bin for 180 days.
ownCloud comes with a built in version control system called Versions. It can be viewed and disabled by logging in with the administrator account and going to the Apps menu.
The way that Versions works is that it copies new and deletes old files, following a specific routine. Copying files every minute will result in rapid data growth, hence the regular deleting of files.
Tech note: Other version control systems store only the differences between old and new versions of a file, but PHP – the language that ownCloud is written in – can't handle working with these incremental changes.
Versions uses the following scheme of copying files:
- For the first 10 seconds ownCloud keeps one version every 2 seconds
- For the first hour ownCloud keeps one version every minute
- For the first 24 hours ownCloud keeps one version every hour
- For the first 30 days ownCloud keeps one version every day
- After the first 30 days ownCloud keeps one version every week
The app is set to never use more than 50% of the user's available free space. When the stored versions of files exceed this limit, Versions deletes the oldest files until it meets the storage usage limit again.
Hover over the file you want to revert or restore and select the Versions option. It can be found between the Download and Share options.
Clicking on this item, a drop down menu appears with two options. Either you click the little arrow to the right and get a list of all the versions of the file saved, or the option to enter an All versions... page.
Clicking on the arrow will produce a list of all the versions saved so far.
Clicking on All versions... will open a new page with all the versions saved so far.
After clicking Revert the page returns a sentence in the color green, stating that the file has been restored to a particular version.
At writing the Versions app was at version 1.0.3. It is stable but there is room for improvement. One weakness for example is that the history listed does not show the name of the user who saved a version of the file.