SharePoint Management Shell commands not working

Tevon2.0 1,106 Reputation points
2023-01-19T20:49:01.6233333+00:00

What would be the best SharePoint Management Shell method of moving these document libraries of this size into another SharePoint site? I have tried to use the following command templates that did not seem to work for exporting the files. Please advise what I did wrong.

Export-SPWeb <Site URL> -Itemurl  <Relative path of List or Library> -path <Backup-path> IncludeUserSecurity -IncludeVersions All

Export-SPWeb http://lg-empctr/ -ItemUrl “/MY HR” -path “C:\Users\sp_farmadmin\Documents\EmpCtr DL” -IncludeUserSecurity -IncludeVersions All

User's image

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint | Development
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Umar Farooq 526 Reputation points
    2023-01-19T20:57:42.09+00:00

    What error message you are getting with this command?

    This should give you bunch of files as export of this list and you can use that to import on the destination site and restore/import the list.

    Export-SPWeb -Identity <SiteURL> -Path <Path and File Name> [-ItemUrl <URL of Site, List, or Library>]

    Another option is you can save the list as template , including content , and use that template to create new list on destination site.

    0 comments No comments

  2. RaytheonXie_MSFT 40,496 Reputation points Microsoft External Staff
    2023-01-20T05:45:07.9066667+00:00

    Hi @Tevon2.0

    In your case, the command to export should be like following

    Export-SPWeb -Identity "http://lg/emp" -Path "C:\Backup\Library\Documents.cmp" -ItemUrl "My%20HR" -IncludeUserSecurity -IncludeVersions All -verbose

    And here is the result in my test

    User's image


    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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.