buzzy: Rigby from Regular Show sitting in front of a computer (Computer Rigby)
Buzzy ([personal profile] buzzy) wrote2013-04-19 12:00 am
Entry tags:

Moo XLVII (or [somewhat] manually transferring data to a new Firefox profile)

I went to bed and Firefox was opened, but it just had one tab open with that "new tab" (about:newtab) page that shows those nine boxes. When I woke up, it was gone. It crashed while I slept, but there was no notification. It just magically closed on its own. When I restarted it, it said it was having trouble opening one of the tabs I had open before...you know, the new tab page. (Such a detailed page, I guess.) Firefox has been acting strange lately and the only thing I could think of doing was creating a new profile and slowly putting all my data into it. There's the Reset feature (Help menu, Troubleshooting Information, Reset Firefox), which I tried, but it didn't fix the problem I had with my history and bookmarks. (History would show up if I did Ctrl+H, but bookmarks would not show up if I did Ctrl+B, and the library (Ctrl+Shift+B) was empty except for three pages that did nothing when clicked. The Library also didn't show any of the normal stuff it should be showing, such as the download history, browsing history, bookmarks, or tags. The entire thing was empty except for those three blank pages. Luckily, I knew what was in my bookmarks; I could just type part of the page title or URL into the address bar.) I looked at what I wanted to save: my history (well, most of it), my cookies, bookmarks, and saved passwords. Here's what I did to save those things.
History: To take care of the history, first, I whittled down the amount of stuff in my history down as much as I could. I got it down to about thirty items. You'll see why this is important in a minute. I used
[Error: Irreparable invalid markup ('<a [...] https://addons.mozilla.org/addon/sqlite-manager">') in entry. Owner must fix manually. Raw contents below.]

<div style="text-align:justify;text-indent:3em;">I went to bed and Firefox was opened, but it just had one tab open with that &quot;new tab&quot; (about:newtab) page that shows those nine boxes. When I woke up, it was gone. It crashed while I slept, but there was no notification. It just magically closed on its own. When I restarted it, it said it was having trouble opening one of the tabs I had open before...you know, the new tab page. (Such a detailed page, I guess.) Firefox has been acting strange lately and the only thing I could think of doing was creating a new profile and slowly putting all my data into it. There's the Reset feature (Help menu, Troubleshooting Information, Reset Firefox), which I tried, but it didn't fix the problem I had with my history and bookmarks. (History would show up if I did Ctrl+H, but bookmarks would not show up if I did Ctrl+B, and the library (Ctrl+Shift+B) was empty except for three pages that did nothing when clicked. The Library also didn't show any of the normal stuff it should be showing, such as the download history, browsing history, bookmarks, or tags. The entire thing was empty except for those three blank pages. Luckily, I knew what was in my bookmarks; I could just type part of the page title or URL into the address bar.) I looked at what I wanted to save: my history (well, most of it), my cookies, bookmarks, and saved passwords. Here's what I did to save those things.</div> <div style="text-align:justify;text-indent:3em;"><cut text="The directions with a small bonus about form and download history, search engines, and extensions"><b>History</b>: To take care of the history, first, I whittled down the amount of stuff in my history down as much as I could. I got it down to about thirty items. You'll see why this is important in a minute. I used <a href="<a href="https://addons.mozilla.org/addon/sqlite-manager">">the SQLite Manager addon</a> to open the file containing the history, places.sqlite. (just select &quot;places.sqlite&quot; from the &quot;(Select Profile Database)&quot; box at the top and click &quot;Go&quot;.) Expand &quot;Tables&quot; if it isn't already expanded, then click &quot;moz_places&quot;. (Click &quot;Browse &amp; Search&quot; if it doesn't go there on its own.) This is all the history. Select every item, (click the first item, hold shift, and click the last item), right-click anything selected, and click &quot;Copy Rows as SQL&quot;. Open up Notepad, and paste that in there. (If you have Word Wrap on, turn that off because it will mess up those lines if you save the file. You'll only be dealing with the first part of each line anyway.) Now close Firefox and SQLite Manager. Create a new profile by running <code style="font-size:1em;">firefox -p</code> (Windows+R key on Windows) and following the prompts. <a href="https://addons.mozilla.org/addon/sqlite-manager">Get SQLite Manager in the new profile by downloading it</a>. Open it up, and again open your places.sqlite and the moz_places table. (Optionally, clear your history before doing it. Again, go to &quot;Browse &amp; Search&quot; if it doesn't go there on its own.) The first column in the moz_places table is the unique identifier column, id. Find the highest number you can find. (Click the header of the &quot;id&quot; column until it turns red if you have a bunch of stuff in your history.) Add one to that number and remember it. If it's completely empty, start at 1. Now go back to Notepad. First off, hit Ctrl+H, and replace all instances of &quot;someTable&quot; with &quot;moz_places&quot;. Now for the part that is the reason you don't want a bunch of items in your history: you have to change all the ID numbers (the first number in quotation marks after the first open parenthesis on every line) so that they start from that number you added one to earlier, and continue to add one to each line so they count up. (You may very well be able to get away with not doing this, but I didn't want to take the chance.) Keep the quotation marks there and be careful not to mess with anything else. Once you have that done, copy all the text, then switch back to SQLite Manager, click the &quot;Execute SQL&quot; tab on the top, then paste it into that &quot;Enter SQL&quot; box. If you click &quot;Run SQL&quot; and it looks like nothing happened, then you're good to go. If you get some gigantic message that goes off your screen, just hit enter...you screwed up somewhere. I don't know where it is, but just check that you didn't delete quotation marks. So now, the history is there.</div> <div style="text-align:justify;text-indent:3em;"><b>Cookies</b>: Now let's work on the cookies. Closed Firefox. Open two windows, one with each profile folder. On Vista and higher, they're located at &quot;%APPDATA%\Mozilla\Firefox\Profiles\&quot; unless you changed it. (You can copy and paste the text in quotation marks into the location bar in Windows Explorer, or paste that into the aforementioned Windows+R box.) Just copy the cookies.sqlite file from the old profile over the new one. I deleted all the cookies I didn't need prior to doing this. That's fairly painless.</div> <div style="text-align:justify;text-indent:3em;"><b>Bookmarks</b>: To restore the bookmarks, open Firefox (with the new profile), hit Ctrl+Shift+B, then click Import and Backup, Restore, and Choose File. Find the &quot;%APPDATA%\Mozilla\Firefox\Profiles\&lt;Old Profile Folder&gt;\bookmarkbackups&quot; folder. Find the file with the latest date and double-click it. Your bookmarks will be back. I hope you didn't start adding bookmarks to your new profile prior to doing this step because this will replace any bookmarks you made with the older ones.</div> <div style="text-align:justify;text-indent:3em;"><b>Saved Passwords</b>: Okay, for the saved passwords, get out of Firefox again. Go back to your two windows with the old and new profile folders. Copy signons.sqlite and key3.db to the new profile. Open up Firefox and the security options, and your saved passwords should be there. If they were password protected, the same master password would be used.</div> <div style="text-align:justify;text-indent:3em;">And that's it! You can close all those windows you had open. Once you're comfortable with your new profile, you can delete the old one when you start Firefox. (You didn't click that &quot;Don't ask at startup&quot; checkbox on the &quot;Choose User Profile&quot; screen, did you? If you did, you can bring it back by hitting Windows+R and typing &quot;firefox -p&quot; again.) In the Choose User Profile screen, select your old profile, and click Delete Profile. With any luck, this will only take a few minutes, as opposed to the few hours of trial-and-error I did to make this.</div> <div style="text-align:justify;text-indent:3em;"><b>Other bits</b>: You can copy any of the following files over from the old profile to the new one if you want these things, though they weren't that important for me. Just copy the files while Firefox is closed.</div> <ul> <li>Download history: downloads.sqlite</li> <li>Extensions (maybe themes too)*: extensions.ini, the extensions folder <li>Form history: formhistory.sqlite</li> <li>Search engines: search.json</li> </ul> <div style="text-align:justify;text-indent:3em;">* If your extensions store data, you may want to take advantage of any abilities they have to back up data and preferences. For example, <a href="http://noscript.net/getit">NoScript</a> has Import and Export buttons at the bottom of the options window, and also provides an Import and Export for its whitelist. Most extensions don't have that kind of feature, and with the wide variety of extensions out there, I couldn't tell you how to move those settings over.</cut></div>