Copy/Export Navigation?

%3CLINGO-SUB%20id%3D%22lingo-sub-332896%22%20slang%3D%22en-US%22%3ECopy%2FExport%20Navigation%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-332896%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20there%20a%20PowerShell%20command%20(or%20other%20way)%20to%20export%20a%20hub%20site%20navigation%20and%20import%20it%20to%20another%20hub%20site%20navigation%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-332896%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-354509%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%2FExport%20Navigation%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-354509%22%20slang%3D%22en-US%22%3EIs%20it%20possible%2C%20that%20the%20Add-PnPNavigationNode%20command%20has%20not%20been%20updated%20yet%20to%20the%20new%20mega%20menu%20options%2C%20like%20a%20header%20that%20isn't%20a%20link%3F%3CBR%20%2F%3EI%20can't%20get%20this%20work%20%3A(%3C%2Fimg%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-334232%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%2FExport%20Navigation%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-334232%22%20slang%3D%22en-US%22%3E%3CP%3Ehi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F237788%22%20target%3D%22_blank%22%3E%40Jens%20Balondo%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%20but%20how%20do%20I%20provide%20credentials%20to%20this%20module%3F%3C%2FP%3E%3CP%3EI've%20opened%20the%20SharePoint%20Online%20Module%20and%20logged%20in%2C%20than%20imported%20the%20module%20and%20ran%20the%20command%20from%20the%20scripts%20comments%2C%20but%20I%20always%20get%20the%20information%20pop%20to%20provide%20credentials%20but%20at%20no%20point%20do%20I%20get%20to%20enter%20any%20credentials.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E*edit*%3C%2FP%3E%3CP%3EI've%20managed%20to%20get%20the%20script%20to%20run%2C%20but%20I%20can't%20produce%20any%20changes%20to%20my%20navigation%20unfortunately.%20No%20Idea%20why.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F60%22%20target%3D%22_blank%22%3E%40Juan%20Carlos%20Gonz%C3%A1lez%20Mart%C3%ADn%3C%2FA%3Ethanks%20for%20your%20input.%20My%20PowerShell%20skills%20are%20limited%20to%20basic%20administration%20and%20some%20modifying%20of%20existing%20scripts.%20I%20can%20get%20the%20navigation%20links%20but%20I%20have%20no%20idea%20how%20to%20export%20or%20copy%20those%20%3A(%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-332996%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%2FExport%20Navigation%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-332996%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Ivan%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FCopy-SPOHubSiteNavigation%2F1.3%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FCopy-SPOHubSiteNavigation%2F1.3%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3CP%3EJens%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-332974%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%2FExport%20Navigation%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-332974%22%20slang%3D%22en-US%22%3ETake%20a%20look%20at%20PnP%20cmdlets%2C%20you%20might%20find%20there%20what%20you%20need%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-823319%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%2FExport%20Navigation%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-823319%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F237788%22%20target%3D%22_blank%22%3E%40Jens%20Balondo%3C%2FA%3E%26nbsp%3BIs%20this%20script%20works%20for%20Mega%20Menu%20as%20well%3F%3C%2FP%3E%3CP%3EAs%20I%20tried%20and%20it%20only%20copied%20the%20first%20level%20of%20navigation%2C%20not%20copied%20sub-navigation%20items.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1387508%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%2FExport%20Navigation%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1387508%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1081%22%20target%3D%22_blank%22%3E%40Ivan%20Unger%3C%2FA%3E%26nbsp%3BAny%20updates%20on%20this%3F%26nbsp%3B%20I%20have%20a%20similar%20requirement%20and%20we're%20using%20megamenu%20three%20deep.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1416054%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%2FExport%20Navigation%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1416054%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1081%22%20target%3D%22_blank%22%3E%40Ivan%20Unger%3C%2FA%3E%26nbsp%3Band%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F361714%22%20target%3D%22_blank%22%3E%40Muzammil_Hussain%3C%2FA%3E%26nbsp%3B-%20I%20found%20a%20script%20that%20works%20with%20mega%20menu!%26nbsp%3B%20I%20ran%20the%20script%20from%20SharePoint%20Online%20Management%20Shell.%26nbsp%3B%20Here%20is%20the%20link%20containing%20the%20script%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fjcallaghan.com%2F2019%2F09%2Freplicate-sharepoint-hub-site-navigation%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fjcallaghan.com%2F2019%2F09%2Freplicate-sharepoint-hub-site-navigation%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20it%20was%20only%20copying%20non-hyperlinked%20headings.%26nbsp%3B%20So%20I%20had%20to%20add%20an%20%22-external%22%20switch%20to%20get%20any%20hyperlinked%20menu%20items%20to%20copy.%26nbsp%3B%20This%20is%20noted%20in%20the%20article%20above%20but%20better%20detailed%20in%20this%20second%20article%20below%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdavegerrard.wordpress.com%2F2019%2F12%2F05%2Fediting-hub-site-navigation%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdavegerrard.wordpress.com%2F2019%2F12%2F05%2Fediting-hub-site-navigation%2F%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1453260%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%2FExport%20Navigation%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1453260%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1081%22%20target%3D%22_blank%22%3E%40Ivan%20Unger%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Ivan%2C%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20use%20the%20Copy-PNPNavigation%20module%26nbsp%3B%3CBR%20%2F%3EYou%20can%20copy%20a%20SharePoint%20Navigation%20Menu%20with%20maximum%203-layer%20with%20this%20script.%20Also%2C%20you%20will%20have%20a%20export%20in%20excel%20type%20from%20the%20site%20navigation!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FCopy-PNPNavigation%2F1.0.2%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FCopy-PNPNavigation%2F1.0.2%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1732714%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%2FExport%20Navigation%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1732714%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F390321%22%20target%3D%22_blank%22%3E%40Saeid_Abdollahzadeh%3C%2FA%3E%26nbsp%3BI%20just%20ran%20this%20module%20and%20got%20the%20following%20message%20%22Backup%20process%20is%20done%2C%20you%20can%20find%20the%20back%20up%20file%20in%20the%20destination%20folder%22%26nbsp%3B%20and%20%22You%20skip%20the%20restore%20process%22.%26nbsp%3B%20%26nbsp%3BCurrently%2C%20I%20cannot%20find%20the%20backup%20excel%20file%20and%20the%20navigation%20in%20the%20destination%20site%20was%20not%20changed.%26nbsp%3B%20Any%20idea%20what%20I'm%20missing%20here%3F%26nbsp%3B%20Thanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1733383%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%2FExport%20Navigation%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1733383%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F796383%22%20target%3D%22_blank%22%3E%40Darren_Smith%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ECopy-PNPNavigation%20-SourceSite%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fcontoso.sharepoint.com%2Fsites%2FSourceSite%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcontoso.sharepoint.com%2Fsites%2FSourceSite%3C%2FA%3E%3CSPAN%3E%26nbsp%3B-BackupDestination%20C%3A%5CFolderOfBackupFile%20-DestinationSite%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fcontoso.sharepoint.com%2Fsites%2FDestinationSite%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcontoso.sharepoint.com%2Fsites%2FDestinationSite%3C%2FA%3E%3CSPAN%3E%26nbsp%3B-NavigationLocation%20TopNavigationBar%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20the%20full%20line%20of%20the%20command.%20You%20have%20to%20enter%20the%20source%20site%20address%2C%20which%20you%20want%20to%20copy%20the%20navigation%20from%20it%2C%20then%20you%20need%20to%20enter%20the%20destination%20folder%20where%20the%20backup%20file%20will%20save%20there.%20If%20you're%20going%20to%20add%20the%20navigation%20menu%20to%20the%20destination%20site%2C%20you%20have%20to%20use%20the%20-DestinationSite%20switch%2C%20otherwise%20the%20backup%20file%20doesn't%20copy%20to%20the%20destination%20site%2C%20and%20you%20have%20the%20backup%20file%20only!%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fsaeid-adz%2FCopy-PNPNavigation%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fsaeid-adz%2FCopy-PNPNavigation%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBR%2C%3C%2FP%3E%3CP%3ESaeid.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1735204%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%2FExport%20Navigation%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1735204%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F390321%22%20target%3D%22_blank%22%3E%40Saeid_Abdollahzadeh%3C%2FA%3E%26nbsp%3BHi%20Saeid%2C%20thanks%20so%20much%20for%20your%20reply%20and%20the%20clarification.%26nbsp%3B%20When%20running%20the%20command%2C%20I%20now%20get%20an%20error%20'D%3A%5CSiteNavigationBackup.xlsx'%20file%20not%20found.%26nbsp%3B%20When%20viewing%20the%20directory%2C%20the%20backup%20file%20was%20never%20written.%26nbsp%3B%20Am%20I%20missing%20something%3F%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1735283%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%2FExport%20Navigation%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1735283%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F390321%22%20target%3D%22_blank%22%3E%40Saeid_Abdollahzadeh%3C%2FA%3E%26nbsp%3Balso%2C%20just%20to%20clarify%2C%20I'm%20running%20Powershell%20as%20an%20admin%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1738298%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%2FExport%20Navigation%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1738298%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20again%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F796383%22%20target%3D%22_blank%22%3E%40Darren_Smith%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20suggested%20that%20you%20use%20a%20specific%20folder%20instead%20of%20the%20drive%20path%20for%20the%20backup%20file!%20for%20example%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECopy-PNPNavigation%20-SourceSite%20%3CA%20href%3D%22https%3A%2F%2FYourSourceSite.sharepoint.com%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2FYourSourceSite.sharepoint.com%3C%2FA%3E%20-BackupDestination%20%3CU%3E%3CSTRONG%3EC%3A%5CBackup%3C%2FSTRONG%3E%3C%2FU%3E%20-DestinationSite%20%3CA%20href%3D%22https%3A%2F%2FYourDestinationSite.sharepoint.com%2Fsites%2FTEST%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2FYourDestinationSite.sharepoint.com%2Fsites%2FTEST%3C%2FA%3E%20-NavigationLocation%20TopNavigationBar%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20will%20see%20the%20%22SiteNavigationBackup.xlsx%22%20in%20the%26nbsp%3B%3CSTRONG%3EBackup%3C%2FSTRONG%3E%20folder!%3C%2FP%3E%3CP%3EIt%20should%20be%20fixed%20by%20this%20command!%3C%2FP%3E%3CP%3EAlso%2C%20make%20sure%20that%20you%20use%20version%201.0.2%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Egood%20luck%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBR%2C%3C%2FP%3E%3CP%3ESaeid.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2107327%22%20slang%3D%22en-US%22%3ERe%3A%20Copy%2FExport%20Navigation%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2107327%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F390321%22%20target%3D%22_blank%22%3E%40Saeid_Abdollahzadeh%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20mine%20did%20not%20turn%20out%20as%20expected%20at%20all...there's%20duplicates%20everywhere.%26nbsp%3B%20What%20do%20I%20do%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22spo.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F250381i1D946B04FA4D4B28%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22spo.PNG%22%20alt%3D%22spo.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Valued Contributor

Is there a PowerShell command (or other way) to export a hub site navigation and import it to another hub site navigation?

14 Replies
Take a look at PnP cmdlets, you might find there what you need

hi @Jens Balondo 

 

Thanks, but how do I provide credentials to this module?

I've opened the SharePoint Online Module and logged in, than imported the module and ran the command from the scripts comments, but I always get the information pop to provide credentials but at no point do I get to enter any credentials.

 

*edit*

I've managed to get the script to run, but I can't produce any changes to my navigation unfortunately. No Idea why.

 

@Juan Carlos González Martínthanks for your input. My PowerShell skills are limited to basic administration and some modifying of existing scripts. I can get the navigation links but I have no idea how to export or copy those :(

Is it possible, that the Add-PnPNavigationNode command has not been updated yet to the new mega menu options, like a header that isn't a link?
I can't get this work :(

@Jens Balondo Is this script works for Mega Menu as well?

As I tried and it only copied the first level of navigation, not copied sub-navigation items.

@Ivan Unger Any updates on this?  I have a similar requirement and we're using megamenu three deep.

 

Cheers!

@Ivan Unger and @Muzammil_Hussain - I found a script that works with mega menu!  I ran the script from SharePoint Online Management Shell.  Here is the link containing the script: 

 

https://jcallaghan.com/2019/09/replicate-sharepoint-hub-site-navigation/

 

However, it was only copying non-hyperlinked headings.  So I had to add an "-external" switch to get any hyperlinked menu items to copy.  This is noted in the article above but better detailed in this second article below:

 

https://davegerrard.wordpress.com/2019/12/05/editing-hub-site-navigation/

@Ivan Unger 

Hi Ivan, 

You can use the Copy-PNPNavigation module 
You can copy a SharePoint Navigation Menu with maximum 3-layer with this script. Also, you will have a export in excel type from the site navigation!

 

https://www.powershellgallery.com/packages/Copy-PNPNavigation/1.0.2

@Saeid_Abdollahzadeh I just ran this module and got the following message "Backup process is done, you can find the back up file in the destination folder"  and "You skip the restore process".   Currently, I cannot find the backup excel file and the navigation in the destination site was not changed.  Any idea what I'm missing here?  Thanks

Hi @Darren_Smith 

 

Copy-PNPNavigation -SourceSite https://contoso.sharepoint.com/sites/SourceSite -BackupDestination C:\FolderOfBackupFile -DestinationSite https://contoso.sharepoint.com/sites/DestinationSite -NavigationLocation TopNavigationBar

 

It's the full line of the command. You have to enter the source site address, which you want to copy the navigation from it, then you need to enter the destination folder where the backup file will save there. If you're going to add the navigation menu to the destination site, you have to use the -DestinationSite switch, otherwise the backup file doesn't copy to the destination site, and you have the backup file only!

https://github.com/saeid-adz/Copy-PNPNavigation

 

BR,

Saeid.

@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?  

@Saeid_Abdollahzadeh also, just to clarify, I'm running Powershell as an admin

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.

@Saeid_Abdollahzadeh 

So mine did not turn out as expected at all...there's duplicates everywhere.  What do I do? 

spo.PNG