Forum Discussion
Copy/Export Navigation?
Saeid_Abdollahzadeh Hi Saeid, thanks so much for your reply and the clarification. When running the command, I now get an error 'D:\SiteNavigationBackup.xlsx' file not found. When viewing the directory, the backup file was never written. Am I missing something?
Hi again Darren_Smith
I suggested that you use a specific folder instead of the drive path for the backup file! for example:
Copy-PNPNavigation -SourceSite https://YourSourceSite.sharepoint.com -BackupDestination C:\Backup -DestinationSite https://YourDestinationSite.sharepoint.com/sites/TEST -NavigationLocation TopNavigationBar
You will see the "SiteNavigationBackup.xlsx" in the Backup folder!
It should be fixed by this command!
Also, make sure that you use version 1.0.2
good luck 🙂
BR,
Saeid.
- rgs-studio365Feb 17, 2024Copper Contributor
Saeid_Abdollahzadeh - I just tried your module after making a couple modifications and it worked great. Updated changes needed where:
- Replace -UseWebLogin with -Interactive (so it supports MFA login)
- Replace SharePointPnPPowerShellOnline with PnP.Powershell
I'm new to Github, so not sure if i did this right, but made the corrections in fork at
https://github.com/saeid-adz/Copy-PNPNavigation/compare/master...robert-studio365:Copy-PNPNavigation:patch-1
Also took me awhile to figure this out, but using "-NavigationLocation QuickLaunch" instead of "-NavigationLocation TopNavigationBar" also worked great with this module.
Thanks for sharing.- rgs-studio365Feb 17, 2024Copper Contributor
@Saeid_Abdollahzadeh - one correction. The first half of the script that copies all the QuickLaunch nav menus to an excel works perfectly. After that there are two problems:
- It doesn't seem to be copying the MenuURL to the target site. And even if it didn't error out, in the spreadsheet the URL is being saved as "sites/SOURCESITE/Sitepages...". Possible to modify the script so that when writing to the new site it updates that relative reference?
- It's generating an error of "Add-PnPNavigationNode: Object reference not set to an instance of an object.".
If you have a chance to update this, that would be greatly appreciated. Thank you.
- AlexanderSalamanderJan 28, 2021Copper Contributor
So mine did not turn out as expected at all...there's duplicates everywhere. What do I do?
- Martien1030Jul 05, 2021Copper Contributor
AlexanderSalamander getting duplicates. Any solutions?
- MrDragonApr 08, 2022Copper Contributor
Martien1030 @AlexanderSalamander
Im also getting such duplicates. Any updates / solutions?