Cleaning a Firefox Profile

I occasionally like to clean my Firefox profile. I test quite a few extensions, and play around a bit, so every once in a while, I just want to clean up. This method has worked rather well for me over the years. Essentially I imported my Netscape 4 profile into Netscape 7, then Mozilla App Suite, then split into Firefox and Thunderbird, so essentially I have data in there that’s several years old. I thought I’d share what I do, and why I do it, in hopes that perhaps someone else would benefit.

These directions were drafted with Firefox 1.5 as a reference point, for older or newer releases the directions may not work (for example if you use a Firefox build with “Places”).

A word of advice:

For the record, this is at your own risk, back up before you touch anything. Backup by copying The Firefox directory as mentioned in respective location below (a directory above Profiles). You’ve been warned.

Directions

You may want to start out by going to the Bookmarks menu and selecting “Manage Bookmarks”. Then cleaning out and organizing your bookmarks, if you want to keep them in your new profile. It’s a good habit to get into.

The first real step I do is visit my profiles directory:

Windows

C:\\Documents and Settings\\[Windows Username]\\Application Data\\Mozilla\\Firefox\\Profiles\\

Mac OS X

~/Library/Application Support/Firefox/Profiles/xxxxxxxx.default/

Your profile will be a directory with a salted name. Something like xxxxxxxx.default. Those x’s are random characters.

Because I only have 1 real profile (and one for dev purposes of which I choose to preserve nothing), I like to rename mine to something else. As far as I’m concerned this one is dead to me. I’m going to also get rid of the profiles.cfg and pluginreg.dat files in the Firefox Folder (up above profiles), then run Firefox and create a new profile on prompt. If you have multiple profiles you wish to leave untouched you would be better off using firefox.exe -profilemanager in the command prompt and simply creating a new profile.

Ok, so now we have this really clean new profile, and that old crusty one with lots of junk. Well, I want some of my stuff in my new clean profile, but only certain things. So here’s a breakdown of what I do, pick and choose as you want. Obviously the less you bring over, the better.

Only perform the following when Firefox is not running.

Bookmarks
Simply copy the bookmarks.html file from the old profile into the new profile.

Cookies (stay logged in with all your sites)
I like to carry these over, since I like being logged into certain sites (forums and such). Just copy the cookies.txt file from the old profile into the new profile. If you open the file up in a text editor you can delete a line or two (get rid of those old cookies, or just to satisfy that tin-foil-hat feeling). Just be careful if you do.

Password
I also like to keep my stored passwords (nothing important, just those news sites, and other silliness that I don’t feel like entering each and every time). Password Manager is great for that. The files you want to copy over are: cert8.db, secmod.db, key3.db, signons.txt.

Extensions
My recommendation on Extensions is to visit addons.mozilla.org (Google for the ones you can’t find) and re-download. The reason I prefer to do that rather than move them over, is because some just seem to stubborn to use the update service, and that leaves me with some old extensions. Also, in this process I typically realize there are one or two that sounded like great ideas, but I just never really used them. Less extensions means less chances for a memory leak. That’s always a good thing.

Search
Just copy the search.rdf file and searchplugins directory over.

Final Notes

This process typically takes me about 5-10 minutes (mainly depending on if I cleanup my bookmarks and cookies). Overall not bad. Gets rid of the crud that tends to accumulate over time, and keeps things pretty lean. This is also pretty useful if you encounter some profile corruption or other ugliness, especially if your one of us trusting soles who occasionally run nightlies from the trunk.

If you do it all correctly, you get a nice clean profile, but still keep your important data. Cache and autocomplete list will rebuild pretty quickly as you use the profile. I’ve found this technique is great for reviving that profile that’s just littered with garbage from various things I’ve done, and extensions I’ve tried.

Hopefully this helps someone.

33 thoughts on “Cleaning a Firefox Profile

  1. Pingback: 17th Degree » Blog Archive » Cleaning a Firefox Profile

  2. Good post, very useful for folks who like to mess with stuff and install tons of extensions.

    BTW, don’t you migrate your preferences as well? If I relied on the default prefs.js, not only would I have to set all my options like tabbed browsing, download actions etc. again, but I would also be back to dismissing every single silly dialog about sending data, secure connections etc. I also have hell of a lot preferences for the extensions.

    However, copying over the old prefs.js also doesn’t seem like a good idea, since it’s part of the mess we’re trying to get rid of. So I once started with the default preferences and while getting my Fx to behave like it used to, I added every single pref I changed to the user.js. Now I have a clean set of preferences I use every time when tidying up my profile.

    Oh, and I even made a batch file to do most of the work for me.

  3. @Ancestor: I keep prefs.js out intentionally because most of the garbage that collects is in prefs.js (you’d be suprised how much a few extensions can throw in there). That’s a good part of the mess we’re trying to clean up.

    Regardless, yes you can copy it over. And even open it in a text editor to get rid of the junk in there.

    Though for most users, they don’t configure many prefs, and can quickly adjust them in a few seconds using the prefs UI.

  4. How can you manually move the extensions over anyway when most of them use cryptic folder names? I’ve wasted time drilling thru them but I’m not going thru that again. Lots of times ext. authors don’t undate anyway come new FF update time…

    If there is a decipherer for this, I’d prolly buy the dang thing. Thx.

  5. Instead of writing
    C:\Documents and Settings\[Windows Username]\Application Data\Mozilla\Firefox\Profiles\
    you can write
    %appdata%\Mozilla\Firefox\Profiles\

  6. @BillyG: It’s intentionally cryptic, to ensure they are unique (they are GUID‘s). No way to go backwards since they aren’t based on the filename. The only way is for you (or a software product) to go through them. This is how naming collisions are avoided.

  7. The way I handle the extension problem is as follows:

    When installing extensions, always save the .xpi file to a folder first before installing.

    Make sure this folder containing the XPI files always represents a current list of all desired plugins, i.e. if you decide you don’t want to use foo, delete foo.xpi.

    After creating the new profile and copying over bookmarks, run firefox and open up the (blank) extension manager.

    Highlight all the XPI files in explorer and drag/drop them onto the extension manager. (You can drag/drop them onto the main firefox window but I find that this only works if there’s only one file — the extension manager window seems to support having multiple files dropped on it.)

    The extensions will now all mass install in one step. Restart firefox and hit the check for updates button to look for anything with a higher version.

    Using this method it’s easy to keep a set of standard extensions that you always use, without having to manually find and download them each time.

  8. Pingback: meneame.net

  9. Nice article.

    I follow another version of this profile cleaning scenario. I just save user.js for the basic Firefox settings, bookmarks.html for bookmarks and chrome directory in profile folder if I have visual adjustments.

  10. Thanks very much for this article — very helpful, and I was able to clear up the problem I was having with Yahoo email pages not formatting correctly!

  11. Understood Robert, hence my last sentence but I guess if I just did as Asteko says (minus the bookmarks since all mine are in a del.icio.us account). If I ever get bogged down, I’ll give that a shot. Also, thx for mentioning about dropping xpi’s into the dl mgr, all these years and I’ve never known that lol. Of course my mgr just gives me the (desired) notice box when done (besides the extra tab that it temporarily uses) so I need to tweak that when the time comes. Thx.

  12. Is there a way to copy over the whitelist for extension installs?
    It’s a little pain to add all the pages to the whitelist again when installating my twenty something extensions.

  13. You can keep form history (very useful) by copying formhistory.dat
    If **** goes in there, just press SHIFT DEL to delete the unwanted entry from the drop down menu. :)

  14. Thanks for the info – I just reinstalled Firefox and now my web based mail says I can’t run script….do you know how I can turn this on
    thanks in advance

  15. Just remember to keep the old profile for a day or two… just in case you need to move stuff over.

    The one thing I have issues with is my Greasemonkey and Stylish scripts. While you can find the GM scripts in a folder in your profile, Stylish scripts aren’t anywhere I can find.

    Ah well… copy and paste works.

  16. Pingback: inqk.net · Copying Your Settings to a New Firefox Profile

  17. Just as a note to everyone and anyone in particular…

    I installed 1.5.0.3 and FF wouldn’t run period…

    Point-blank, EOF…

    To tell you that this pissed me off is an understaement. I usually and regualarly update FF and for it to stop working, just hanging in my task manager, not showing me any love at all 😡

    -profilemanager works, but then I lost my bookmarks (which I happen to have on another box, I learned that lesson quickly!) :mrgreen:

    Thanks on that, but just out of curios – what are ALL of the switches that can be used with FF, are they listed somewhere in partic. ular?

  18. Pingback: Slaanesh’s blog » Blog Archive » Nettoyer un profile firefox

  19. good stuff Robert.
    ..I’d add hostperm.1, which stores allowed web sites for popups & software installation.

  20. cool stuff roberts how to clean cache of all user profiles
    C:\Documents and Settings\usr\Local Settings\Application Data\Mozilla\Firefox\Profiles

    have been trying this from long time cant do it can clean cache in the present default profile.

    Any help is appreciated

  21. Pingback: links for 2007-07-21 « Mandarine

  22. Hello, please to help me. I had problems with my computer because drop down and I lost all my stuff. Your program was very help full. Please can you give it back to me? Thank you in advance!
    Vjera

  23. XRumer is the premier automated link-building tool. Through the use of this tool you will see a significant increase in the number of unique visitors to your site, as well as see your site jump in the search engine result pages. The tool is popular among both novices and gurus because of both its flexibility, power, and effectiveness. XRumer is extremely reliable and its fully automated workflow makes link-building a breeze.
    http://www.botmaster.ru/product16368/

  24. Very useful, thanks! Does anyone know how to do this in Firefox 3? Are the files the same?
    Thanks!

  25. In most cases a product’s rating went down, expanding the range between highest and lowest rated.Unlike Kaspersky, Symantec provides Norton users with little explanation of its features or settings, either in the configuration settings or on its technical support section. Also we don’t like Norton’s dependency on Internet Explorer to explain Help items or services provided by Symantec (windows pop up in IE even when Firefox is your default browser), or that fee-based services have once again crept into the technical support section. Having improved a lot
    last year in Symantec’s flagship antivirus product, it makes sense we’d see more modest enhancements for this year’s Norton AntiVirus 2008. While Norton
    AntiVirus.

  26. Any updates for Firefox 3 on this? Best I can tell, Firefox 3 doesn’t use bookmarks.html now that it’s switched to places for handling this data. With that change in mind, I can’t help but wonder what else has changed. Any advice?

  27. Seems like a batch file could be created to copy the necessary files stated above, elsewhere, then delete all contents, then copy them back in making it a far quicker process… I may look into it, but if anyone else writes one, let us know :)

  28. Thanks – firefox been crashy lately..

    scripted this up – it now lives here:

    ~/Library/Application Support/Firefox/Profiles

    #!/bin/bash

    old=$1
    new=$2

    [[ -n $old && -d $old ]] || { echo old dir \”$old\” DNE; (( err++ )); }
    [[ -n $new && -d $new ]] || { echo new dir \”$new\” DNE; (( err++ )); }
    (( err )) && exit $err;

    for file in bookmarks.html cookies.txt cert8.db secmod.db key3.db signons.txt search.rdf searchplugins
    do
    echo Copying over $file
    [[ -f $old/$file ]] && cp -v $old/$file $new/
    [[ -d $old/$file ]] && cp -rv $old/$file $new/
    done

    echo ‘/Applications/Firefox.app/Contents/MacOS/firefox -profilemanager’

Leave a Reply

Your email address will not be published. Required fields are marked *

Connect with Facebook