Recovering a profile that suddenly disappeared

From MozillaZine Knowledge Base
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This article was written for Thunderbird. For Firefox and SeaMonkey, see the article Recovering a missing profile

Thunderbird has a nasty habit of once in a great while forgetting about the existence of a profile if it uses the default name. When this occurs, you suddenly start up in the new account wizard and it looks like you lost everything. You haven't. It's just lost track of your profile, which is probably intact.

Another possibility is that your prefs.js file is empty or corrupt due to either Windows or Thunderbird crashing. Your prefs.js file has all of your account information and settings. In this case you haven't lost any of your mail or address books, but Thunderbird no longer knows how to fetch new mail or send messages, or display the folders in the folder pane. You'll need to recreate the accounts in Thunderbird unless you have a backup or unless it created a copy with a different name (for example, prefs-1.js).

Which problem do you have?

A quick way to tell which problem you're suffering from is to look at your personal address book within Thunderbird. If it looks okay, go to the Corrupt or empty prefs.js section. Otherwise, follow the instructions in the Lost profile section.

If Thunderbird didn't run the new account wizard when it started up, see Disappearing mail if some or all of your messages aren't visible in Thunderbird or see Empty folders if some of your folders are empty.

Lost profile

1. Follow the instructions on how to move a profile. This will tell Thunderbird again where your profile is stored.

2. Use the profile manager to change the name of your profile to a unique name to prevent this problem from occurring again.

That's it, you are done.

If this doesn't work:

  • Did you try more than one of the methods to move a profile?
  • Thunderbird looks in the profiles.ini file to find what profiles you have and where they are. It won't ignore bad entries in that file. If you have only one profile that you care about and you can't recover it delete the profiles.ini file and then follow the instructions on how to move a profile by creating a new profile and copying the contents of the old one over it. Thunderbird will create a new good profiles.ini for you when it creates the new profile. Profiles.ini is stored in the Thunderbird directory above where your profiles are stored by default.
  • See if you can make a backup of the lost profile using Mozbackup. Then use Mozbackup to restore the profile.

If you run into problems don't spend too much time trying different ways to move your profile. Take a moment and confirm that your profile is still intact, and then consider whether it would be quicker to recover the data from the old profile than to keep trying to move it.

Is your profile intact?

Normally your profile is intact, and it just takes several tries to figure out how to move the profile. However, at some point you may want to do a sanity check that your profile is still intact. The easiest way is to open a console window (DOS box) and use a -profile "path" command line argument per this article to run Thunderbird using your profile. If that works then you know that your profile is okay, you just need to figure out whats causing your problem in moving the profile.

If that doesn't work (or you're not sure whether you made an error in using the command line arguments):

  • Find the profile . See this article if you can't see the files.
  • Look for a abook.mab file. Thats your personal address book.
  • Look for a prefs.js file. That's your settings.
  • The "inbox." file is a mbox file used to store the messages for a inbox folder. The Mail subdirectory should have subdirectories named after each accounts mail server, each of which has a "inbox." file. For example, if you use Gmail there should be a "inbox." file at Mail\pop.gmail.com . A 127.0.0.X directory occurs when you use a add-on or extension to support webmail. As a minimum you should have a Mail\Local Folders directory with a "inbox." file even if all of your accounts use a global inbox or you only use IMAP accounts.

If you have your personal address book, your settings, and your inbox folders your profile is probably intact. You can either try to move the profile again, or migrate your data to a new profile per the next section. It's more work (you'll need to create the accounts again, re-install any extensions/themes you had added, and recreate any customizations you had made) but not as difficult.

Recovering data from your old profile

  • Create a new profile using the Profile Manager. Make certain you pick a unique name so that this problem doesn't occur again.
  • Use the ImportExportTools extension (it used to be called the mboximport extension) to import the folders from your old profile. Your folders are stored as mbox files. They are text files with the folders name and no file extension. For example, your inbox folder is "inbox.". You'll notice other files with the folders name and a .msf file extension. Ignore them, they don't have any messages.
  • Copy your old address books to the new profile.

See Importing folders if you have problems installing the ImportExportTools extension. You probably left clicked on the download URL instead of right clicking and selecting "save link as".

Once things are working, read this article for how to recover the less important files.

Corrupt or empty prefs.js

A "empty" pref.js file typically isn't totally empty. It may have a few lines such as

user_pref("mail.smtpservers", "");
user_pref("mailnews.quotingPrefs.version", 1);
user_pref("mailnews.ui.threadpane.version", 5);
user_pref("prefs.converted-to-utf8", true);

or a couple dozen lines setting lots of unimportant preferences. Whats important is whether it still contains your account information, not how big it is.

Find the profile . See this article if you can't see the files.

Open the prefs.js file with a text editor such as Notepad (don't double click on it using Windows Explorer) and search for the string mail.account . It's used in statements such as user_pref("mail.account.account1.server", "server1") to define an account, and it's used in statements such as user_pref("mail.accountmanager.accounts", "account1, account2, account3") to list what accounts exists. If you can't find any, then your prefs.js file is either empty or corrupt.

1. Exit Thunderbird and make a backup copy of the prefs.js file.

2. Try to find a good copy of prefs.js that you can use to replace the bad one.

If you have a backup of your profile replace the "bad" prefs.js file with one from your backup. If you made your backup using Mozbackup you can unzip the "*.pcv" backup file as described here to get the backed up prefs.js file. Otherwise see if Thunderbird might have created a copy of your old prefs.js file using a slightly different filename such as prefs-1.js or prefs.bak. Check that it has account information before using it, you can't assume that it's a good copy just because it's larger. If it has account information, rename it to prefs.js and check whether its a read-only file. If so, change its file properties so that its writable. If you are using Windows you can do that by right clicking on the file in Windows Explorer, selecting Properties, clicking the General tab, unchecking the read-only checkbox, and pressing the OK button.

3. If you can't find a good copy of prefs.js try running CHKDSK to recover the file. You may be able to recover it in a C:\FOUND.000 directory. If you're using Linux or OSX try using fsck to recover the file.

4. Otherwise you will need to rebuild prefs.js. You can do this by creating the same accounts again in the existing profile and setting Thunderbird to use the local directories that still contain the missing mail, per this article. Another option is to create a new profile using the Profile Manager , create the accounts again, and then migrate your mail , address books, filters and other mail related files from the old profile per this article .

Once things are back to normal you might want to install the MailTweak extension. It has a preferences cache that will automatically restore prefs.js if your account settings disappear. However, thats no substitute for regularly backing up your profile.

See also

External links