Import Safari Bookmarks from XML Export

bookmarksplist

Awhile back, I set up a cron job on my wife's MacBook to automatically backup her Safari bookmarks to Dropbox every morning using the following command that I found online (I forget where):

/usr/bin/plutil -convert xml1 $HOME/Library/Safari/Bookmarks.plist -o ~/Dropbox/Backup/Bookmarks/wife.xml

This worked swimmingly until all of her bookmarks were lost. When I try to import this file using File > Import Bookmarks in Safari, it says that it can't find any bookmarks in the file. I've opened the file up and looked at it and while I'm not terribly familiar with the XML plist format, it looks reasonably complete/intact.

I've tried renaming the file to wife.html and doing the same import process, but no dice. I was about to start writing my own little parser in Python but I figured I'd ask you nice folks before spending the time.

Is this something I can fix fairly easily? She has a buttload of bookmarks and I'd love it if this were easy 🙂

Thanks in advance – do let me know if you need any additional information to make providing an answer easier.

Best Answer

I've carried my bookmarks with me after the first import ever since Safari 1.0 by just dragging/dropping the file into the Safari folder in ~/Library. Why did you go through the hassle of conversion?

Just backup the plist and drop it in place of the old or newly made plist whenever required.