How can I copy a SharePoint Online site and its content to a new URL in the same tenancy using PowerShell?

SteveH 0 Reputation points
2023-09-14T09:27:11.94+00:00

Hi,

Could someone please provide the PowerShell code required to copy a customized SharePoint Online site and its content to a new URL within the same tenancy?

The source site is the top-level site in a site collection with no subsites, and I need to copy all content to the new URL.

I only have site collection admin rights so I can not make a site template.

Thank you.

Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sam Hutchings 6 Reputation points
    2023-09-14T12:50:18.9833333+00:00

    Hi Steve,

    There was a similar question previously which a script has been provided as the solution:

    https://learn.microsoft.com/en-us/answers/questions/861017/powershell-script-sharepoint-online-copy-library-c

    Kind regards,
    Sam


  2. Yanli Jiang - MSFT 31,671 Reputation points Microsoft External Staff
    2023-09-15T07:20:18.7933333+00:00

    Hi @SteveH ,

    The currently used method of copying a site, for SharePoint Online, the official method is "Save site as template" and has limitations: the storage of the file inside the template should no more than 50mb. And you need to have at least SharePoint admin and site collection admin permissions.

    Or use third-party tools. I found an article about copying sites with only site collection admin permissions. You can refer to:

    https://documentation.sharegate.com/hc/en-us/articles/115000597507

    Note: The third-party product that this article discusses is manufactured by a company that is independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of third-party products referenced in this article.


    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.