Saturday, June 30, 2012

How to Retain, Save, or Migrate Your Bookmarks When Upgrading Tor on Windows

As of Tor Browser version 4.02, I was able to upgrade to version 4.03 today (January 16, 2015) through an in-browser clickable notice, which also allowed me to restart Tor. Afterwards, all my bookmarks were automatically imported. However, below are the instructions in case you wanted to import bookmarks the way you did before.

So now that you can use Tor to bypass paywalls on websites that have metered content (though I encourage you to pay your fair share to media organizations like the LA Times that are doing a great deal of social good), we will discuss how, on Windows, you can retain, save, or migrate your bookmarks, when upgrading Tor on Windows. You can use Tor to browse the web anonymously, maintaining your privacy and keeping your online activity hidden from despotic governments and intrusive corporations. "I'm not doing anything wrong, so I have nothing to hide." True, although most of us would not welcome indoor cameras in our homes, because as your home is your castle, your own home computer should be your castle.

From participating in and reading online discussion, I've gathered that the method we're about to detail below cannot be applied to Tor installations on Mac and Linux operating systems. For now, the following process should work on Windows only.
  1. Soon as you see "HOWEVER, this browser is out of date" (or in previous versions, "there is a security update available for the Tor Browser Bundle"), download the new package. Henceforth, the Tor installation that you plan to replace will be the old, and the Tor installation that contains the latest fixes and security updates will be the new.
  2. In your old Tor folder, there is a folder containing your valuable bookmarks information. On Windows 7, if you're upgrading Tor version 3.6.6 to Tor version 4.0, the old Tor's places.sqlite file will be in:
    Tor Browser\Data\Browser\profile.default
    If you're upgrading Tor version 2.3.x (and earlier) to Tor version 3.5.x, the old Tor's places.sqlite will be in
    Tor Browser\FirefoxPortable\Data\profile
    Inside this folder, identify the file named places.sqlite and place it on your desktop by copying the file and pasting it onto your desktop.
  3. Navigate to the location containing your old Tor folder, and move the entire folder containing your old Tor into a temporary location, such as your recycle bin. Do not permanently erase the old folder just yet, until you've confirmed that the new Tor works. You may want to keep the old Tor around in case the new Tor doesn't work correctly on your computer (more on this later).
  4. Once you've moved the old Tor to a new location, download and uncompress the new Tor folder, and place it on your desktop
  5. Inside the new Tor folder, click to run Start Tor Browser.exe
  6. Once the new Vidalia is open, running, and has notified you that you are connected to Tor, wait for the new Tor browser to open up automatically. Once it has done so, immediately close and exit the browser and Tor.
  7. In step 6, what we did was run for the first time a brand new instance of new Tor. New Tor created a new default bookmarks file. By exiting new Tor, we are now able to replace the new Tor's newly created default bookmarks file with your old Tor's bookmarks file. Navigate to the location where your new Tor's default bookmarks file is stored. New Tor's places.sqlite file will be in:
    Tor Browser\Browser\TorBrowser\Data\Browser\profile.default
    Once you are in your new Tor's "profile.default" folder (in Tor 2.3.x and earlier, you will be in the "profile" folder), confirm that there is a file called places.sqlite. You are going to replace the new Tor's places.sqlite with the old Tor's places.sqlite.
  8. Locate the places.sqlite file that you had copied and previously set aside from your old Tor, which should be on your desktop. Copy the places.sqlite file from the old Tor into the "profile.default" folder. Confirm that you want to replace the new Tor file with the old Tor file.
  9. Navigate away from the "profile.default" folder window, to the "Tor Browser" window, and click to run Start Tor Browser.exe. Wait for the new Tor browser to open up, and you should now see your old bookmarks.
As an aside, I have been confronted with how buggy Tor on Windows can be. To this day, I still haven't been able to figure out the root of a problem I encountered when upgrading Tor, but I have devised a workaround.

I'm currently running tor-browser-2.2.35-13, I attempted to upgrade to tor-browser-2.2.37, and was met with the following:

Tor Browser_Vidalia  was unable to start the configured web browser
Vidalia was unable to start the configured web browser
Vidalia is the graphical controller and view of Tor's connections and settings. Startled and confused by this weird message, I get the sense that, for some unknown reason, tor-browser-2.2.37 just doesn't work for me. I decide to download and install the next level up, tor-browser-2.3.12-alpha-2. Everything seemed to be going ok, up to Vidalia starting and telling me I was connected to Tor. The next step was for the Tor browser to automatically pop open on my screen, but it never did. All that would happen was that Vidalia would run, but the Tor browser never appeared or opened up. I assumed this was because there was a bug with the alpha release, so I attempt to revert and go back to my last known working version of Tor Browser Bundle, 2.2.35-13. This time, when the Tor browser opens up, instead of the familiar message "Congratulations. Your browser is configured to use Tor.", I now have a new problem:

Tor Browser_proxy server is refusing connections
The proxy server is refusing connections

Firefox is configured to use a proxy server that is refusing connections.

Check the proxy settings to make sure that they are correct.
Contact your network administrator to make sure the proxy server is working.
Whiskey. Tango. Foxtrot. Maybe I should go into Windows Registry and remove all traces of Tor. In regedit, I deleted all registry keys I could find after searching for
Tor Browser, tor-browser, tbb, tor, vidalia
Presumably, I had wiped the slate clean, and could reinstall Tor like I was installing Tor for the first time. I again tried the last known working version of Tor. Darn, no go! I got the exact same "proxy server is refusing connections" messages as before. I then decided to abandon Tor Browser Bundle, and try to install Tor on Firefox. In an act of desperation, I tried installing TorButton for Firefox, even though this is no longer in active development. This was to no avail, because I got the same messages; in fact, what I ultimately did with Firefox was erase my Firefox tabs and wipe out all the cookies I had accumulated. I then tried to install Tor on Google Chrome, and again got the same "proxy server is refusing connections" messages. To my utter shock, I had run out of ideas and had no working Tor browser on my computer, and had no clue even what the problem could be or where to go next. At a definite low point, frustrated, preoccupied, I kept fiddling around, until I hit on a bit of luck. Recall that I had three different "Tor Browser" folders from the installation packages for 2.2.35-13, 2.2.37-1, and 2.3.12-alpha-2. Keeping them all straight was a hassle, so I simply relabeled my last known working version as "Tor Browser, last known working, now broken". This was 2.2.35-13. Out of habit, I clicked on Start Tor Browser.exe, and lo and behold, Tor was working again! As an experiment, I went to the "Tor Browser" folder for 2.2.37-1, and simply changed the name of that folder, from "Tor Browser", to "Tor Browser_a". That worked too!

In conclusion, your inability to connect to Tor, signified by the "proxy server is refusing connections" messages, can be overcome if you simply rename your "Tor Browser" folder to another name other than "Tor Browser". For me, I renamed it simply "Tor Browser 2.2.37-1" and now I've got working Tor with all the latest security updates.

So what is the root of the problem? Given that I had gone into my Windows registry, and tried to remove all traces of Tor, I am at a loss. Frankly, I don't have the patience or the motivation to delve into and figure out the problem. My best guess is that something happened with Tor, Windows, or the interplay between the two, that has Windows associating the folder C:\Program Files (x86)\Tor Browser\ with a defective version of the Tor protocol. Even going into Windows registry and trying to remove all traces of Tor seems to be of no effect.

Once I got Tor working again, and figured out the workaround, was the moment where the Pope gets off the airplane and bends down to kiss the ground.

Update: Since filing an official bug report, I have been in contact with a Tor developer, who told me that the problem of seeing the message "Vidalia was unable to start the configured web browser" can be avoided if you make it part of your routine to store your Tor folder on your desktop, instead of in C:\Program Files (x86):
Only installed applications go in C:\Program Files (x86). The Tor Browser Bundle is self-contained and does not actually install itself onto your computer, it just runs whenever you click the Start Tor Browser.exe icon. If you run Tor from the Desktop, then you should not have any problems with Vidalia not being able to start the browser - now or when you upgrade.