pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
990 stars 663 forks source link

Move-PnPFolder not working between two sites #2748

Open omarmallat opened 4 years ago

omarmallat commented 4 years ago

Reporting an Issue or Missing Feature

Missing Feature with Move-PnPFolder

Expected behavior

Move Folders between two different sites (this feature is available in the web UI, where you can select folders and then move them to a different site)

Actual behavior

Only work within the the same site!

Steps to reproduce behavior

parameters not available to select a new site!

Which version of the PnP-PowerShell Cmdlets are you using?

PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

3.22.20

How did you install the PnP-PowerShell Cmdlets?

MSI Installed downloaded from GitHub

ghost commented 4 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

KoenZomers commented 4 years ago

@omarmallat This is indeed a limitation of Move-PnPFolder at the moment. What you can use instead if having the June 2020 or later release installed is:

Move-PnPFile -ServerRelativeUrl /sites/source/shared%20documents/Test -TargetServerRelativeLibrary /sites/target/shared%20documents -Force -OverwriteIfAlreadyExists -IgnoreVersionHistory -AllowSmallerVersionLimitOnDestination -AllowSchemaMismatch

to move your folder between site collections. Yes, the name PnPFile is confusing, but it does work for folders as well. Will look into if we can update Move-PnPFolder to support it as well.

KoenZomers commented 4 years ago

Have given updating Move-PnPFolder to support this a thought, but decided for now to just update the documentation on Move-PnPFolder to state that the cmdlet is only for moving folders within a site and Move-PnPFile should be used instead if wanting to move between site collections.

The documentation updates as well as the ability to copy files and folders using Copy-PnPFile will be published through PR https://github.com/pnp/PnP-PowerShell/pull/2749

omarmallat commented 4 years ago

Is there any limitation on Move-PnPFile? when I execute it on a folder, it moved everything except a file.mov size=6.5GB. strangely, the command did not return any error. I noticed it was very quick, while I was expecting more time. after investigation, I noticed everything was moved except that big file!