Forum Discussion
matthewcarterACG
Jul 20, 2023Copper Contributor
either rename a document library url or move files to new library retaining metadata
Hi all, we are in the process of moving files over from file explorer file server into sharepoint online. we are using sharepoint migration tool to do this, all works well, and metadata retained...
SvenSieverding
Jul 20, 2023Bronze Contributor
Hi matthewcarterACG ,
if you use PnP Powershell (https://pnp.github.io/powershell/) then you can change the url part of a list like this
$OldListName = "Doc1"
$NewListURL = "Doc1a"
$List.Rootfolder.MoveTo($NewListURL)
Invoke-PnPQuery
if you have an identical library doc2 (with the same metdata columns als doc1a) then you can use the "Move-PnPFile" Commandlet to move a file including all metadata and the history (as long as you stay in the same site collection)
Move-PnPFile -SourceUrl "doc1a/Document.docx" -TargetUrl "doc2"
Best Regards,
Sven