SharePoint Online document libraries include the option to move content to a different location. But what happens to the metadata when this content is moved?
This post explains what happens to the metadata when different types of content stored in a SharePoint Online document library is moved (not copied) using the ‘Move to‘ option to a different library in either the same site or a different site (both in SharePoint Online).
TL:DR
If you don’t have time to read all the details, here is a summary. When content is moved between SharePoint document libraries (same site or other sites) using the built-in ‘Move to’ functionality, the following occurs for all types of content:
- The original system generated metadata (Created, Modified) is retained for all types of content.
- The original Document ID is retained for all types of content only if the destination site has the Document ID feature enabled.
- Information Protection labels (set on Office document only) are retained unless a label setting prevents the move.
- Retention labels are retained for all types of content.
- Any added metadata is lost for all content unless the destination library has exactly the same metadata columns. However, Office documents may retain those values in their XML structure.
- The same outcomes occur if documents are moved between two synced document libraries in File Explorer.
Metadata in SharePoint libraries
All SharePoint document libraries include four types of metadata:
- System generated. Examples include the Created [in SharePoint, not the original item created date] and Modified dates, the Created by and Modified by names, File size, Content Type, sequential ID, and Version History (which is a collection of metadata objects). If Document IDs are enabled, it also includes the Document ID (PREFIX-LibraryID-sequential ID, eg ‘RECORDS-12312322-234). Note that every object saved to SharePoint is also assigned a unique GUID.
- Name. This is either the original name of the item (in the case of an email, the email subject line), or added by an end-user. Note that this is NOT the same column as the Title column which is blank by default.
- Added metadata. That is, pre-existing or custom site, or ‘local’, metadata columns added to the library. In the examples used in this post, the added metadata is ‘Document Type’ (choice, default =’Agenda’), ‘Event Type’ (choice, default =’Indoor’), and ‘Random Text’ (text, default = ‘Elephant’).
- Compliance metadata (when applied). Retention label, Label applied by, Label setting, Sensitivity (for Information Protection labels).
It is important to note that metadata in added metadata columns in one library will NOT appear in the destination library unless that (destination) library has exactly the same columns.
For the purpose of this post, four different types of content (Office/Word document, PDF, email (.msg and .eml), image) were moved from a library with multiple metadata elements shown below to an empty document library in brand new site with nothing configured at the site or library level.
The metadata elements set on the source site library were as follows:
- Document IDs
- Document Type (choice)
- Event Type (choice)
- Random Text (default set to ‘Elephant’)
- Retention label applied to the library and a different label applied at the folder level
- Information Protection label. This was only applied to Word documents (when they were edited) as there was no option to apply it to the emails, PDFs or images.

Moving a PDF, email (msg) and image
As the outcome is likely to be the same for all non-Office content, a PDF, email (msg) and image were all moved at the same time to the destination library. Immediately a notification appeared that metadata properties on all three items would be lost if they were moved. The option to ‘Move anyway’ was selected and the items were moved.

The destination library shows the three items without the Document IDs (which were not enabled) or any of the added metadata columns. However, the items have retained the Retention label – no retention has been set anywhere on the destination site.

Were the Document IDs moved?
No. The original Document IDs did NOT appear because the destination library did not have the Document ID feature enabled.
Once that feature was enabled and the column was made visible in the list view, we can see that the three items that were already moved have lost their original Document IDs. Two new items moved have retained their original source Document ID (CORPRECORDS-667097513-n).

Moving Office documents
The metadata applied to Office documents (Word, Excel, PowerPoint with an ‘x’ at the end) works in a similar way but those documents also embed the metadata in their underlying XML structure.
Some of this metadata is visible in, and can be directly edited from, the Info properties of the document. For example, in this document …

… we can see the Document ID, Document Type, Random Text and Event Type in the Info properties. These metadata properties remain with the document even when it is downloaded and so can be very useful to determine the origin of a document if, for example, it is found as an email attachment or on a network file share.

Where is this metadata embedded?
All Office documents with a document extension that ends in ‘x’ (e.g., docx) are based on an XML structure that can be viewed by converting the original to a zip file (using the CMD shell and REN to rename it) and then extracting the resulting zip file and opening it.
The XML structure of a standard Word document looks like the following. The XML documents contained in the structure can be viewed with simple text viewers like NotePad.

The system, added and embedded metadata properties are stored in one of the XML documents named item1 to item 4 in the customXml folder. The following shows the values applied in item1, while item 4 contains the other values that can be assigned to choice fields.


The metadata for the Sensitivity label (including any formatting details) is stored in the ‘custom’ XML document in the docProps folder.
BUT – details of the Retention label are not stored in the XML properties of the downloaded document. This may be because once the document is downloaded, the retention label no longer applies.
What happens to that metadata when Word documents are moved?
As with the previous examples, a warning will indicate that metadata properties may be lost. If ‘Move anyway’ is selected, the document is moved.
If the document has an Information Protection label setting that prevents it, it may not be possible to move it. The following message will be displayed. The only way to move it is to change the label to one that allows it, or remove the label.

For any other Office document, the original Document ID and Retention label are retained but any added metadata properties will be lost if those columns do not exist in the destination library.

However, it seems that the added properties are not completely lost; they are moved to the ‘custom’ XML document in the docProps folder.

However, if the same metadata column is added to the library, documents that have this added metadata in the ‘custom’ XML document do not display that metadata. It must be added back.
What happens if the destination library has the same metadata columns?
If the destination library has the same added metadata columns, as shown in the example below, that metadata will be copied to the destination library. The first Word document in the example below was copied before the metadata column was added.

Summing up
When content is moved between SharePoint document libraries (same site or other sites) using the built-in ‘Move to’ functionality, the following occurs for all types of content:
- The original system generated metadata (Created, Modified) is retained for all types of content.
- The original Document ID is retained for all types of content only if the destination site has the Document ID feature enabled.
- Information Protection labels set on Office document only are retained unless a label setting prevents the move.
- Retention labels are retained for all types of content.
- Added metadata is lost for all content unless the destination library has exactly the same metadata columns. However, Office documents may retain those values in their XML structure.
Is there a method of creating SharePoint Document Libraries in different (or the same) site based on a Document Library template in (modern) SharePoint online?
Hi Karl, according to this website https://sharepointbabe.com/2020/05/18/save-library-as-template-in-sp-online/ the only way to do it in SharePoint Online is to run a PowerShell script to ‘restore’ the ability to save libraries as templates. 3 Set-SPOsite $SiteURL -DenyAddAndCustomizePages 0
Thanks for sharing that article, I’ll have a read. Regardless, I’ve since solved the complication we were facing, with the top down Global Term Store approach to metadata. Keep on blogging, it’s great!
Thanks Karl. I’m not a huge fan of using the Global Term store approach for all metadata because most of the time the terms you want to use relate to a single site (or sometimes just a library) so can be created as site or library choice columns (including with default values). One example – ‘Document Type’. You may have up to 70 types, but on a specific site the user just wants to select from 3 – 5. Another example – Function/Activity names. These are often better as default options on libraries. All of that said, I’m sure there are use cases for term store metadata. I prefer to keep it simple as much as possible.