I have a weekly requirement to refresh a list in a lower ONPREM environment with ONPREM production data with consistency in the IDs.
The content is in a Production SPWEB list, and needs to overwrite the equivalent Staging SPWEB list. Can't overwrite the entire contentdb. There is a dependency on the ID's matching in both environments.
I'm using Production export-spweb and Staging import-spweb.
export-spweb -Identity https://intranet.contoso.local/depts/hr/ -ItemUrl "Lists/Employees" -includeversions 2 -path "F:\backup\hr_employees_list.cmp" -CompressionSize 100 -Verbose
Import-SPWeb https://STAGEintranet.contoso.local/depts/hr/ -Path "C:\backup\hr_employees_list.cmp"
When I view the export-spweb log, I can see the ID applied to the list item.
In Staging, I tried deleting the existing ContosoListA items from the list (but leave them in stage1 recycle bin). When I run an import, the item IDs increment: I had 150 items in the Staging list, put them in stage 1 recycle bin, imported the Production list cmp, and the items incremented from 151-300.
I feel like I've done this before but no luck yet. Do I need to permanently remove the Staging list items from Recycle Bin?
Much thanks.