0

Did a lot of research and tests but can't find a working solution. I have a few aspx site pages and I want to back them up onto network drive or my c drive because I don't want to lose them. but I cannot find a easy way to back them up. i have tried trying to download from the site pages but it doesn't show right when i save it outside of SharePoint. then I tried going to SharePoint designer and extracting the file from there. it keeps in a aspx file that opens up to code when its save outside of SharePoint. I may be on the right path but must being missing something. can someone help me?

1

You can use PowerShell cmdlets to do that.

A demo for your reference:

$web = Get-SPWeb "http://sp13/sites/team" 
$list = $web.lists["Site Pages"] 
$items = $list.items 


 foreach($item in $items) 
 {

    $ie = new-object -ComObject "InternetExplorer.Application"
    $url = "http://sp13/sites/team/"+ $item.Url
    $ie.silent = $true
    $ie.navigate($url)
    while($ie.Busy) { Start-Sleep -Milliseconds 100 }
    Start-Sleep 10
    $targetFilePath=$item.DisplayName
    $ie.Document.documentElement.innerHTML > "C:\Pages\$targetFilePath.html"
    $ie.Stop()
    $ie.Quit()
 }

More information, you can refer to: Archive SharePoint aspx pages as html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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