List item IDs will not be preserved in migrations performed without Insane mode enabled, or when running a migration with Insane Mode to an On-Premises destination.
These two scenarios use the regular SharePoint API which assigns the List Item IDs values automatically. Preserving the List Item IDs for any version of SharePoint using this API would require that we manipulate the content database directly, resulting in voiding your SharePoint warranty. Due to this, and the fact that the database is not available on Office 365, List Item IDs cannot be supported outside of Insane Mode or to an On-Premises destination.
Disclaimer: The following workaround is provided as-is, without any warranty or support. It has not been tested for all scenarios, and as a result it may not work in all cases. In the case that this workaround does not work or stops working, there is no alternative solutions we can provide.
Should you wish to attempt to preserve list item IDs without using the Office 365 migration API, the following workaround is offered as an alternative:
Note: The following procedure will allow you to preserve list item IDs, however it involves some manual steps and it will not preserve permissions, version history and attachments.
- Ensure Sharegate's performance options are set to Minimal (this will ensure a single thread so that the IDs are copied sequentially. If another settings is set, it might not work because of multi-threading).
- Make sure your destination list is a fresh one (it never had any items created in it, not even if they were deleted afterwards).
- Copy items (in any order) in your destination list until you have items with the same ID numbers as at the source (even if the wrong items have the wrong IDs). For example, if you have IDs 1 to 100 in your source list, make sure you have items with IDs 1 to 100 in your destination list.
- If there are "gaps" in IDs at the source (for example, no item with ID 30), you will need to delete the items in the destination in order to have the same gaps (so in my example, delete the item with ID 30).
- In Sharegate, click on Bulk Edit Metadata and connect to your source list.
- Select all the items and click Excel -> Export -> Export Now to export all the items to an Excel file.
- In Sharegate, go back and use Bulk Edit Metadata again to connect to your destination list.
- Click Excel -> Import to import the Excel file created at step 4. Select "Import Now".
- Create a new column (single line of text) in the destination list called Old ID (or another preferred name).
- Map the ID column from the source to that new Old ID column through the map properties option.
- Make the workflow use that column instead.