0

I usually export list and libraries using the following command:-

Export-SPWeb -Identity "http://frontend2/commercial/" -ItemUrl "Pages" -Path "c:\exportfile.cmp"     -nofilecompression  -IncludeVersions All -IncludeUserSecurity -Force -Verbose

which will export all the pages inside a library named "Pages". but my question is if i can only export certain pages, for example to define a query (using CAML or using Powershell) , to only export wiki pages which have a site column named "Type" = "Policies" ??

if this is not possible using Export-SPWeb command,then how i can export certain wiki pages from my Pages library ? and then to import them inside another farm ??

2
  • 1
    Seems like you would need to export and import the entire list and just delete the pages that you don't want to keep.
    – Mike
    Nov 3, 2017 at 21:23
  • @Mike hi Mke, thanks for the comment... the problem i have around 2500 wiki pages and i only need to export/import 50 wiki pages... now export 2500 wiki pages will created a file of around 2.5 GB, then i need to move it to another farm and do the import operation... so i am not sure if there is a more reliable way to just export the related 50 wiki pages which have there "Type" = "Policies"?? is this possible as per ur knowledge ?
    – John John
    Nov 4, 2017 at 1:04

1 Answer 1

1

Another similar way is to export/import the library, to clone it to another "staging" library, use powershell to delete all the items where Type != Policies, then export that library and move it to another farm.

Like this:

$web = get-spweb http://sharepoint/subsite
$list = $web.Lists["Cloned Document Library Name "]
$items = $list.Items | ? {$_["Type"] -ne "Policies"}
$items.Count #make sure you have the right number
$items | %{

$_.Delete();

}

Then export and import that library to the second farm.

2
  • yes should work, but i was searching if export only the intended pages from the beginning...
    – John John
    Nov 6, 2017 at 16:14
  • 1
    There is no such process with Export-SPWeb I'm afraid
    – Mike
    Nov 7, 2017 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.