SharePoint 2019 - Import-SPWeb -IncludeUserSecurity - Updates to system roles is not allowed

Adrián Ďurica 0 Reputation points
2024-09-17T05:45:48.66+00:00

I have a problem when moving a subsite to a new site collection with the same URL when using the Import-SPWeb command and its IncludeUserSecurity parameter.

Structure:

Manage Path: /a - Explicit

Site collection: https://webapp.com/a

Subsite: https://webapp.com/a/b/c

Manage Path: /a/b/c - Explicit

New Site collection: https://webapp.com/a/b/c

Export and import commands:

Export-SPWeb -Identity $subsiteURL -Path $backupLoc -IncludeUserSecurity -IncludeVersions All -NoLogFile -NoFileCompression -Force -Verbose

Import-SPWeb -Identity $url -Path $backupLoc -UpdateVersions Overwrite -NoLogFile -NoFileCompression -Force -IncludeUserSecurity -Verbose

When Import-SPWeb I get the error "Import-SPWeb: Updates to system roles is not allowed.". For example, I get this error for a file that has inheritance stopped but when requesting access to the site. Without the IncludeUserSecurity parameter it is successful. I have read that I am not the only one having the same problem, maybe this parameter is not working from the beginning.

User's image

Is there another way to move subsites to site collection with URL preservation? Am I making a mistake somewhere or is the command just not working correctly with the IncludeUserSecurity parameter?

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,399 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,000 questions
{count} votes

2 answers

Sort by: Most helpful
  1. basel el-halabi 5 Reputation points
    2024-12-17T05:19:37.55+00:00

    I have great news! I was able to identify the issue, which can be triggered on site collections originally created in SharePoint 2007. According to my communication with Microsoft Support, a fix for this issue is scheduled to be released in the upcoming January 2025 update.

    1 person found this answer helpful.
    0 comments No comments

  2. AllenXu-MSFT 22,081 Reputation points Microsoft Vendor
    2024-09-17T07:07:18.0766667+00:00

    Hi @Adrián Ďurica,

    I couldn't reproduce this issue in my environment.

    My commands:

    Export-SPWeb -Identity "http://sp19/sites/test/sub" -Path "C:\ExportFileName.cmp" -IncludeUserSecurity -IncludeVersions All -NoLogFile -NoFileCompression -Force -Verbose
    
    Import-SPWeb -Identity "http://sp19/newsub" -Path "C:\ExportFileName.cmp" -UpdateVersions Overwrite -NoLogFile -NoFileCompression -Force -IncludeUserSecurity -Verbose
    

    User's image

    My SharePoint build number is 16.0.10337.12109. You can check yours with this PowerShell:

    $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
    
    write-host $farm.BuildVersion
    

    And did you run your commands in SharePoint 2019 management shell as administrator?

    Also if you try moving a blank subsite or to a new target site, will it work? I want to confirm whether it is caused by the content of your source subsite or target site.

    Thanks.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.