SOLVED
Home

Automate Edge-Favorites Backup as HTML-File

%3CLINGO-SUB%20id%3D%22lingo-sub-965680%22%20slang%3D%22en-US%22%3EAutomate%20Edge-Favorites%20Backup%20as%20HTML-File%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-965680%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20need%20to%20automatically%20Backup%20the%20Users%20Edge-Favorites%20as%20File%20(prefered%20HTML-Export%2FImport-Format)%20when%20doing%20an%20automated%20User-Data-Backup.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20Favorites%20are%20stored%20in%20JSON-Format%20in%26nbsp%3B%3CFONT%20face%3D%22courier%20new%2Ccourier%22%20color%3D%22%230000FF%22%3E%25APPDATALOCAL%25%5CMicrosoft%5CEdge%20Beta%5CUser%20Data%5CDefault%5CBookmarks%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20is%20a%20nice%20functionality%20in%20Edge%26nbsp%3B%3CA%20href%3D%22edge%3A%2F%2Ffavorites%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eedge%3A%2F%2Ffavorites%2F%3C%2FA%3E%20to%20export%20all%20Favorites%20as%20HTML%20File.%20Exactly%20this%20Export%20as%20HTML-File%20I%20like%20to%20trigger%20(e.g.%20by%20a%20Backup-Script)%20when%20doing%20a%20Userdata-Backup%20of%20the%20Machine.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20possibility%20to%20do%20this%2C%20e.g.%20like%20calling%20msedge.exe%20with%20an%20argument%20like%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%22--export-Bookmarks-to-HTML%3DC%3A%5CBackupData%5CBookmarksBackup.html%22%3C%2FFONT%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-966968%22%20slang%3D%22en-US%22%3ERe%3A%20Automate%20Edge-Favorites%20Backup%20as%20HTML-File%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-966968%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%2F60488%22%20target%3D%22_blank%22%3E%40Gunnar%20Haslinger%3C%2FA%3E%2C%20are%20you%20trying%20to%20do%20this%20export%20%2F%20import%20as%20part%20of%20a%20system%20restore%2C%20or%20some%20other%20scenario%20where%20you%20need%20to%20have%20a%20domain%20policy%20or%20other%20automated%20solution%3F%26nbsp%3B%20The%20favorites%20should%20import%20automatically%20if%20you%20have%20enabled%20sync%20for%20the%20user%2C%20and%20the%20user%20has%20added%20favorites%20in%20the%20past.%26nbsp%3B%20I%20would%20like%20to%20better%20understand%20the%20context%20around%20why%20you%20are%20trying%20to%20export%20and%20import%20favorites%20automatically.%26nbsp%3B%20Thanks%20-%20Elliot%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-967689%22%20slang%3D%22en-US%22%3ERe%3A%20Automate%20Edge-Favorites%20Backup%20as%20HTML-File%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-967689%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239638%22%20target%3D%22_blank%22%3E%40Elliot%20Kirk%3C%2FA%3E%26nbsp%3Bthe%20Export%2FImport%20is%20not%20running%20as%20a%20system-restore%20or%20system-process%2C%20it%20is%20an%20Automated%20(daily)%20User-Backup%20running%20as%20automated%20Process%20executed%20in%20User-Context%20(typically%20before%20User-LogOff).%20But%20LocalAppData-Folder%20is%20not%20covered%20in%20the%20User-Backup%20(AppData%5CRoaming%20would%20be)%20and%20LocalAppData%20is%20way%20too%20big%20to%20include.%20Just%20the%20Bookmarks%20should%20be%20included.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECurrent%20Solution%20with%20old%20EdgeHTML%20is%20the%20Tool%20EdgeBackup%20which%20exactly%20does%20this%20-%20it%20can%20be%20executed%20to%20export%20the%20EdgeHTML%20Bookmarks%20to%20an%20HTML-File%20and%20put%20this%20HTML-File%20in%20the%20UserDataBackup%20of%20the%20machine.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20the%20User%20needs%20to%20restore%20the%20Bookmarks%20(e.g.%20because%20of%20moving%20to%20a%20new%20Computer)%20this%20can%20be%20done%20by%20the%20User%20manually.%20The%20HTML-File%20can%20be%20restored%20in%20any%20Browser%20(EdgeHTML%2C%20EdgeChromium%2C%20Firefox)%20we%20use.%3C%2FP%3E%3CP%3ESyncing%20with%20cloud%20is%20not%20an%20option%2C%20the%20Networks%20the%20Machines%20are%20connected%20to%20are%20air-gapped%20(no%20direct%20Ontenet-Access).%20Browser%20is%20used%20for%20Intranet-AccessOnly.%20And%20even%20if%20there%20would%20be%20Internet-Access%2C%20our%20Policy%20says%20users%20must%20not%20use%20these%20Cloud-Services.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1019789%22%20slang%3D%22en-US%22%3ERe%3A%20Automate%20Edge-Favorites%20Backup%20as%20HTML-File%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1019789%22%20slang%3D%22en-US%22%3E%3CP%3EAs%20there%20is%20no%20Solution%20provided%20by%20Microsoft%2C%20I%20created%20a%20Script%20(as%20a%20workaround).%20I%20published%20it%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fgunnarhaslinger%2FMicrosoft-Edge-based-on-Chromium-Scripts%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fgunnarhaslinger%2FMicrosoft-Edge-based-on-Chromium-Scripts%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1060589%22%20slang%3D%22en-US%22%3ERe%3A%20Automate%20Edge-Favorites%20Backup%20as%20HTML-File%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1060589%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F60488%22%20target%3D%22_blank%22%3E%40Gunnar%20Haslinger%3C%2FA%3E%26nbsp%3BMany%20thanks%2C%20just%20tried%20your%20script%20and%20it%20works%20perfrctly%20and%20it%20will%20save%20me%20a%20great%20deal%20of%20messing%20around%20as%20I%20am%20testing%20Edge-Chrome%20and%20as%20we%20know%20favorites%20arent%20handled%20without%20using%20microsoft%20profile%20cloud%20sync%20-%20I%20posted%20another%20mention%20of%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Gunnar Haslinger
Contributor

We need to automatically Backup the Users Edge-Favorites as File (prefered HTML-Export/Import-Format) when doing an automated User-Data-Backup.

 

The Favorites are stored in JSON-Format in %APPDATALOCAL%\Microsoft\Edge Beta\User Data\Default\Bookmarks

 

There is a nice functionality in Edge edge://favorites/ to export all Favorites as HTML File. Exactly this Export as HTML-File I like to trigger (e.g. by a Backup-Script) when doing a Userdata-Backup of the Machine.

 

Is there a possibility to do this, e.g. like calling msedge.exe with an argument like "--export-Bookmarks-to-HTML=C:\BackupData\BookmarksBackup.html"

4 Replies

Hi @Gunnar Haslinger, are you trying to do this export / import as part of a system restore, or some other scenario where you need to have a domain policy or other automated solution?  The favorites should import automatically if you have enabled sync for the user, and the user has added favorites in the past.  I would like to better understand the context around why you are trying to export and import favorites automatically.  Thanks - Elliot

@Elliot Kirk the Export/Import is not running as a system-restore or system-process, it is an Automated (daily) User-Backup running as automated Process executed in User-Context (typically before User-LogOff). But LocalAppData-Folder is not covered in the User-Backup (AppData\Roaming would be) and LocalAppData is way too big to include. Just the Bookmarks should be included.

 

Current Solution with old EdgeHTML is the Tool EdgeBackup which exactly does this - it can be executed to export the EdgeHTML Bookmarks to an HTML-File and put this HTML-File in the UserDataBackup of the machine.  

 

If the User needs to restore the Bookmarks (e.g. because of moving to a new Computer) this can be done by the User manually. The HTML-File can be restored in any Browser (EdgeHTML, EdgeChromium, Firefox) we use.

Syncing with cloud is not an option, the Networks the Machines are connected to are air-gapped (no direct Ontenet-Access). Browser is used for Intranet-AccessOnly. And even if there would be Internet-Access, our Policy says users must not use these Cloud-Services.

Solution

As there is no Solution provided by Microsoft, I created a Script (as a workaround). I published it here: https://github.com/gunnarhaslinger/Microsoft-Edge-based-on-Chromium-Scripts

@Gunnar Haslinger Many thanks, just tried your script and it works perfrctly and it will save me a great deal of messing around as I am testing Edge-Chrome and as we know favorites arent handled without using microsoft profile cloud sync - I posted another mention of this.

 

Related Conversations