{"id":67,"date":"2011-07-04T01:55:47","date_gmt":"2011-07-04T06:55:47","guid":{"rendered":"http:\/\/t.tam.atbh.us\/?p=67"},"modified":"2012-05-28T21:58:17","modified_gmt":"2012-05-29T02:58:17","slug":"old-firefox-bookmarks","status":"publish","type":"post","link":"https:\/\/tamashii.co\/en\/old-firefox-bookmarks\/","title":{"rendered":"How to retrieve your Firefox bookmarks from a backup"},"content":{"rendered":"<p>In my latest post I wrote a long rant about why I don&#8217;t like Firefox. Actually, after my rant, I started analyzing what was wrong with my PC. The answer was promptly received: I was using the incorrect version of the operative system. So, in a brilliant spur of the moment, I returned to Windows XP. It took a whole day to set everything up, and I had lots of problems, but what&#8217;s worth is that my system is back into commission, and with better performance but less eye-candy.<\/p>\n<p>And Firefox is still here, making himself comfortable, even if I don&#8217;t want him to be. I&#8217;m slowly trying to migrate to my new choice, after I set it up the most I can as Firefox. However, as always, I did a backup of my personal files, game save states, fonts, sounds, cursors, etcetera, before reinstalling Windows, so that I don&#8217;t lose them during the downgrade.<\/p>\n<p>Despite my backup, Firefox is a weird app. Since the version 3.0, Firefox uses SQLite to store your personal profile information: bookmarks, configurations, everything. That makes it weird to work with a backup. The generic process to restore a backup is to copy-paste all the session files from the backup to the Firefox profile folder in Documents and Settings (2000\/XP) or Users (Vista\/7). But I don&#8217;t want to restore the whole session! I only want my bookmarks, in a list! That&#8217;s when the wheels started running.<!--more--><\/p>\n<p>SQLite is a pretty standard format, thus, any SQLite editor\/viewer works. In my case I searched for one that was portable, so that I don&#8217;t have to install it. I found <a title=\"SQLiteSpy\" href=\"http:\/\/www.yunqa.de\/delphi\/doku.php\/products\/sqlitespy\/index\" target=\"_blank\">SQLiteSpy<\/a>, a dependence-free application, that allows you to access SQLite 3 databases, and run queries on their info freely. The app is free for personal and educational use.<\/p>\n<div id=\"attachment_70\" style=\"width: 310px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/t.tam.x10.mx\/wp-content\/uploads\/2011\/07\/2011-07-04-00-56-06_SQLiteSpy.png\" data-rel=\"lightbox-image-2\" data-rl_title=\"\" data-rl_caption=\"\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-70\" class=\"size-medium wp-image-70\" title=\"\" src=\"http:\/\/t.tam.x10.mx\/wp-content\/uploads\/2011\/07\/2011-07-04-00-56-06_SQLiteSpy-300x198.png\" alt=\"\" width=\"300\" height=\"198\" \/><\/a><p id=\"caption-attachment-70\" class=\"wp-caption-text\">SQLiteSpy main window, after opening my bookmark file.<\/p><\/div>\n<p>Now then, after running it, we simply clic on <strong>File<\/strong> and then <strong>Open Database&#8230;<\/strong> In the Open box we go to the next path, depending on our backup and operative system.<\/p>\n<p><strong>In Windows XP:<\/strong> &lt;User profile folder&gt;Application DataMozillaFirefoxProfiles&lt;some characters&gt;.&lt;Firefox profile name&gt;.<\/p>\n<p><strong>En Windows Vista o 7:<\/strong> &lt;User profile folder&gt;AppDataRoamingMozillaFirefoxProfiles&lt;some characters&gt;.&lt;Firefox profile name&gt;.<\/p>\n<p>In my case, my whole backup path was <em>G:ABCTamashiiAppDataRoamingMozillaFirefoxProfiles_2zni7hoct.Default<\/em>. Your&#8217;s should be pretty different.<\/p>\n<p>Inside that folder we should open the file named <em>Places.sqlite<\/em>. By default SQLiteSpy doesn&#8217;t shows files with a file extension different than DB or DB3, so, in the Open box we can filter with <strong>Files of Type<\/strong>: <em>Any Type<\/em>. Once you found it, you click on Open. The file has several tables, but I&#8217;ll only go into detail with two of them: <em>moz_places<\/em> and <em>moz_bookmarks<\/em>. The first table, <em>moz_places<\/em>, is the general storage of all the visited URLs, stored by the History system, including some stats and additional information. The second table, <em>moz_bookmarks<\/em>, contains information about which of those URLs have been configured as bookmarks, including the bookmark title and more information.<\/p>\n<p>Now, knowing this information, how can you retrieve your bookmarks and their titles? Very simple. In the upper section of the SQLiteSpy window there is an edit box. You can write a SQL query there, and the program will execute it. The query you have to write is:<\/p>\n<pre>SELECT bm.title, pl.url FROM moz_bookmarks AS bm, moz_places AS pl WHERE bm.fk = pl.id;<\/pre>\n<div id=\"attachment_71\" style=\"width: 310px\" class=\"wp-caption alignright\"><a href=\"http:\/\/t.tam.x10.mx\/wp-content\/uploads\/2011\/07\/2011-07-04-01-01-09_SQLiteSpy.png\" data-rel=\"lightbox-image-3\" data-rl_title=\"\" data-rl_caption=\"\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-71\" class=\"size-medium wp-image-71\" title=\"\" src=\"http:\/\/t.tam.x10.mx\/wp-content\/uploads\/2011\/07\/2011-07-04-01-01-09_SQLiteSpy-300x198.png\" alt=\"\" width=\"300\" height=\"198\" \/><\/a><p id=\"caption-attachment-71\" class=\"wp-caption-text\">SQLite just ran my query... And I obfuscated some of my entries there for security.<\/p><\/div>\n<p>Basically, all this query does is something like &#8220;Show me the title and URL of the rows of both tables which id is equal in both.&#8221;. To run it, click on the <strong>Execute<\/strong> menu and then choose the first option, <strong>Execute SQL<\/strong>. The table view will update it self to show the stored information. Some of the entries will look odd, or like you never created a bookmark for them. That&#8217;s because Firefox stores the RSS feeds as bookmarks, so they will show up there if you were subscribed to any of them (in my case, they just popped up there).<\/p>\n<p>The process is painless and pretty useful. You can then go to the <strong>Edit<\/strong> menu, choose <strong>Select All<\/strong>, and then <strong>Copy<\/strong>, and there you have your bookmark list, completely ready (tab separated) to be pasted in a spreadsheet, or a text file, or in any other place. It is more convenient than installing Firefox and creating a new session just to see those bookmarks&#8230; And then, finding out how to export them.<\/p>\n<p><strong>For expert users<\/strong>: There are several other fields in the <em>moz_places<\/em> table, in example a simple visit counter (<em>visit_count<\/em>) and a ranking that the Firefox designers created, named <em><a title=\"Frecency\" href=\"https:\/\/developer.mozilla.org\/en\/The_Places_frecency_algorithm\" target=\"_blank\">Frecency<\/a><\/em>. Basically, it&#8217;s an algorithm that tries to measure how frequently a page is visited, how recently, and from where. It gives out more weight to writing the URL in the Address Bar, than to click in a bookmark, than to visit it from other page. <em>Frecency<\/em> helps the browser know which pages to recommend when you write something in the Address Bar.<\/p>","protected":false},"excerpt":{"rendered":"<p>In my latest post I wrote a long rant about why I don&#8217;t like Firefox. Actually, after my rant, I started analyzing what was wrong with my PC. The answer was promptly received: I&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/tamashii.co\/en\/wp-json\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tamashii.co\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tamashii.co\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tamashii.co\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tamashii.co\/en\/wp-json\/wp\/v2\/comments?post=67"}],"version-history":[{"count":0,"href":"https:\/\/tamashii.co\/en\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"wp:attachment":[{"href":"https:\/\/tamashii.co\/en\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tamashii.co\/en\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tamashii.co\/en\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}