Understanding SharePoint Online Versioning

SharePoint Online Versioning is Useful in Many Ways

SharePoint Online and OneDrive for Business both support file versioning. This is a useful feature that does not exist for documents stored on local drives or file shares. Storing multiple versions of files allows you to revert to an earlier version of a document if necessary. For example, a file might become corrupt because of a hardware or software problem or the files in a document library might be encrypted by a cyberattack.

Usually restoring a library works well and can help to avoid the need to deploy third-party backup products, but like any technology, library restores can go wrong. Some preparation and practice to recover from uncommon (hopefully) events is always worthwhile.

Features Supported by File Versioning

File versioning supports many SharePoint features, including:

  • Users can restore a previous version of a document to become the current version with the Version history option in the SharePoint Online and OneDrive for Business browser clients (Figure 1).
  • Office ProPlus and Online applications (Word, Excel, and PowerPoint) use file versioning for their document AutoSave These apps can open a previous version of a document and compare its content against the current version. Apps can also restore a previous version.
  • The continual synchronization of changes made to documents permits real-time updates for co-authoring of Office documents.
  • SharePoint Online and OneDrive for Business can restore document libraries to a point in time within the past 30 days.
Version history for a file stored in a SharePoint Online document library
Figure 1: Version history for a file stored in a SharePoint Online document library (image credit: Tony Redmond)

By default, SharePoint and OneDrive for Business enable versioning for all document libraries (you need to enable it for lists). SharePoint Online supports major and minor versions while OneDrive for Business only supports major versions. In SharePoint document management terminology, a major version is published, and a minor version is an unpublished draft. But the way people work with SharePoint Online today through interfaces like Teams means that most document versions are major.

AutoSave and Versioning

The AutoSave feature in Office ProPlus applications (Word, PowerPoint, and Excel) automatically captures changes made to documents stored in SharePoint and OneDrive for Business libraries. The idea is that a user can work on a document without having to worry about saving it because any change they make is saved to the server on an ongoing basis. The feature isn’t supported for files stored on local or shared drives. AutoSave uses versioning to capture edits made using the Office desktop applications and online apps. AutoSave is unsupported for non-Office files because only the Office apps can synchronize small differential changes back to SharePoint to create new versions on the server.

In Figure 2, a Word document has some AutoSave features exposed. The AutoSave slider is on, meaning that documents are being saved automatically to the server as changes occur. Clicking the document title tells us where the document is stored and allows us to select the Version History link. This opens the Version History pane to show the different versions stored on the server. We can then open a previous version to compare its content against the current version and restore it if necessary.

AutoSave features in Word
Figure 2: AutoSave features in Word (image credit: Tony Redmond)

New versions aren’t generated for each change made to a document. Sets of changes are gathered by the server and are periodically committed to create a version. During a session, a new version might be generated every ten minutes or so, depending on the volume and type of edits in a document. For instance, pasting a large amount of text into a document usually forces Word to create a new version. If the app loses connection to the server, the server creates a new version to make sure that no data is lost.

A long editing session can easily generate 20-30 versions of a document. In some cases, many more versions are kept. For instance, several hundred versions are typically stored for the chapter files for the Office 365 for IT Pros eBook. The storage requirement for versions is mitigated using shredded storage in SharePoint Online to capture and store versions efficiently. The BLOBs used for document storage are broken up into “shreds” (roughly 64KB). As users update documents and create versions, SharePoint only needs to update the affected shreds. When documents are opened, SharePoint combines the shreds and delivers the complete file. Shredding has a big positive effect on large documents that gets better as more versions exist. Microsoft introduced shredded storage in SharePoint 2013 and has improved it since, notably with the addition of the Background Intelligent Transfer (BITS) protocol in SharePoint 2016 to enhance and speed client uploads and downloads.

Continuously saving documents as authors make changes makes the Office co-authoring feature more seamless. Updates made to a file by one user are synchronized to the server and back to the copies open by other users within seconds. Co-authoring is possible without AutoSave, but users must manually refresh their copies of documents to see changes.

Controlling AutoSave

You can change AutoSave options in the Office ProPlus apps or update group policy settings, but you cannot affect how the cloud Office apps save document edits. Figure 3 shows how easy it is for a user to decide that AutoSave is on or off for new Excel worksheets. The same settings exist for Word and PowerPoint.

AutoSave options in Excel
Figure 3: AutoSave options in Excel (image credit: Tony Redmond)

Setting Version Limits

SharePoint Online (and OneDrive for Business leverage file versioning to be able to restore a library to a user-selected point up to 30 days ago. By default, SharePoint Online and OneDrive for Business libraries support a minimum of one hundred major versions. You can’t disable versioning in library settings and must choose a value between 100 and 50,000 for the number of versions kept (Figure 4).

Versioning settings for a SharePoint Online document library
Figure 4: Versioning settings for a SharePoint Online document library (image credit: Tony Redmond)

Keeping hundreds of versions of documents might seem excessive, but if those versions are not present, it might not be possible to recover important documents to a specific point in time. An argument can be made that 500 is too many versions to keep and that 100 is better, and if you decide on this route you’ll have to edit the setting for each library to reset the limit as this value can’t be set with PowerShell.

No Minimum Versioning

Organizations who don’t want to enable minimum versioning must run the Set-SPOTenant cmdlet to disable the feature. To disable the feature, download the latest version of the PowerShell module for SharePoint Online and run the command:

Set-SPOTenant -EnableMinimumVersionRequirement $False

Disabling minimum versioning to reduce the number of versions kept to under 100 isn’t recommended unless you have very good reason for this course of action.

Versions Are Goodness

The cost of losing important documents can be very high. Quite how high depends on how important and sensitive the documents are. In that context, keeping a few additional versions is a small price to pay for the benefits gained. With that thought in mind, perhaps it’s best to leave the 500-version limit in place.