Forum Discussion
milosha
Nov 26, 2019Copper Contributor
Sharepoint online copy to/move to issues
Hello, we are fully migrated do O365, so this question is not connected with migration issues. We use the copy/move functionality between libraries, folders within libraries or between sites ...
Nabil450
Jan 28, 2021Copper Contributor
milosha
Hello,
Same problem for me.
Tried to copy a folder from a SP site to another from the web interface. The content was copied partially for no apparent reason. I waited a day and still no progress.
This is really a pain!
I'm trying Powershell now and hope it will go through!
First install the module:
Install-Module PNP.Powershell
Then create a PS1 file with this content (edit it according to your need):
#Config Variables
$SiteURL = "https://domain.sharepoint.com/sites/sourcesite"
$SourceFolderURL= "sourcelibrary/sourcefolder"
$TargetFolderURL = "/sites/targetsite/targetlibrary"
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)
#Copy Folder to different site collection
Copy-PnPFile -SourceUrl $SourceFolderURL -TargetUrl $TargetFolderURL
Then run it:
PS C:\temp> .\"copy to script.ps1"
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential
Confirm
Copy file '/sites/sourcesite/sourcelibrary/sourcefolder' to '/sites/targetsite/targetlibrary'?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
https://www.sharepointdiary.com/2018/04/copy-folder-in-sharepoint-online-using-powershell.html#ixzz6kpd0esfX