MozillaZine

Moving from Windows to Linux deletes local IMAP e-mails

User Help for Mozilla Thunderbird
sldayo
 
Posts: 4
Joined: July 13th, 2019, 5:00 am

Post Posted July 13th, 2019, 5:45 am

Hello,

I am trying to move my Thunderbird profile from Windows 10 to Pop!_OS and have some problems with Thunderbird clearing all of the locally stored e-mails for IMAP accounts. I also have to re-enter all of the server passwords. POP e-mail folders are not cleared.

After moving my profile, Thunderbird starts up and shows all e-mails, including the ones from the IMAP accounts. I can browse all of my e-mails at this point. Once I restart Thunderbird, my e-mails are gone.

These are the files that exist beforehand:

Code: Select all
sl@sal-w1:~/.thunderbird/Profiles/447w58yh.default/ImapMail/imap.googlemail.com$ ls -la
total 553884
drwxr-xr-x  3 sl sl      4096 Jul 13 14:23  .
drwxr-xr-x 20 sl sl      4096 Jul 13 11:19  ..
-rw-rw-r--  1 sl sl      1291 Jul 13 14:23  Archives.msf
-rwxr-xr-x  1 sl sl        80 Mar 18  2013  filterlog.html
-rwxr-xr-x  1 sl sl      2529 May 19 11:46 '[Gmail].msf'
drwxr-xr-x  2 sl sl      4096 Jul 13 14:23 '[Gmail].sbd'
-rwxr-xr-x  1 sl sl 555607445 Jul 13 11:24  INBOX
-rw-rw-r--  1 sl sl      1473 Jul 13 13:48  INBOX-1.msf
-rw-rw-r--  1 sl sl      1360 Jul 13 14:23  INBOX-2.msf
-rwxr-xr-x  1 sl sl   8956816 Jul 13 11:25  INBOX.msf
-rwxr-xr-x  1 sl sl       230 Mar 18  2013  msgFilterRules.dat
-rwxr-xr-x  1 sl sl      3262 May 19 11:47  Personal.msf
-rwxr-xr-x  1 sl sl      2986 May  1  2018  Receipts.msf
-rwxr-xr-x  1 sl sl     92294 Feb 14  2015  Sent
-rwxr-xr-x  1 sl sl     23513 May  1  2018  Sent.msf
-rwxr-xr-x  1 sl sl      1505 Jul 13 14:23  Templates-1.msf
-rwxr-xr-x  1 sl sl      1543 Sep 19  2016  Templates.msf
-rwxr-xr-x  1 sl sl     69255 Aug 12  2017  Trash
-rwxr-xr-x  1 sl sl     13630 Jul 13 11:20  Trash.msf
-rwxr-xr-x  1 sl sl      2858 May  1  2018  Travel.msf
-rwxr-xr-x  1 sl sl      2827 Feb 14 14:58  Work.msf


After leaving Thunderbird running for a while, I noticed that it had deleted some files:

Code: Select all
sl@sal-w1:~/.thunderbird/Profiles/447w58yh.default/ImapMail/imap.googlemail.com$ ls -la
total 553664
drwxr-xr-x  3 sl sl      4096 Jul 13 14:28  .
drwxr-xr-x 20 sl sl      4096 Jul 13 11:19  ..
-rwxr-xr-x  1 sl sl        80 Mar 18  2013  filterlog.html
drwxr-xr-x  2 sl sl      4096 Jul 13 14:28 '[Gmail].sbd'
-rwxr-xr-x  1 sl sl 555607445 Jul 13 11:24  INBOX
-rw-rw-r--  1 sl sl      1436 Jul 13 14:28  INBOX-2.msf
-rwxr-xr-x  1 sl sl   8956816 Jul 13 11:25  INBOX.msf
-rwxr-xr-x  1 sl sl       230 Mar 18  2013  msgFilterRules.dat
-rwxr-xr-x  1 sl sl     92294 Feb 14  2015  Sent
-rwxr-xr-x  1 sl sl     69255 Aug 12  2017  Trash


Attempting to navigate inboxes in Thunderbird at this point gives me an alert box:

Code: Select all
Unable to open the summary file for Inbox. Perhaps there was an error on disk, or the full path is too long.


After restarting Thunderbird, the remaining important files are also deleted:

Code: Select all
sl@sal-w1:~/.thunderbird/Profiles/447w58yh.default/ImapMail/imap.googlemail.com$ ls -la
total 11076
drwxr-xr-x  3 sl sl    4096 Jul 13 14:32  .
drwxr-xr-x 20 sl sl    4096 Jul 13 11:19  ..
-rwxr-xr-x  1 sl sl      80 Mar 18  2013  filterlog.html
-rw-rw-r--  1 sl sl       0 Jul 13 14:32 '[Gmail].msf'
drwxr-xr-x  2 sl sl    4096 Jul 13 14:32 '[Gmail].sbd'
-rw-------  1 sl sl    1739 Jul 13 14:33  INBOX-1.msf
-rw-rw-r--  1 sl sl    1453 Jul 13 14:31  INBOX-2.msf
-rwxr-xr-x  1 sl sl 8957123 Jul 13 14:31  INBOX.msf
-rwxr-xr-x  1 sl sl     230 Mar 18  2013  msgFilterRules.dat
-rwxr-xr-x  1 sl sl   92294 Feb 14  2015  Sent
-rwxr-xr-x  1 sl sl   69255 Aug 12  2017  Trash


I have shared the Thunderbird profile in the past between Ubuntu, macOS and Windows without too much trouble, so I expected this to work without any major problems. Now I only want to move the profile.

This is how I moved the profile:
  1. Uninstalled all addons while using Thunderbird on Windows and compacted inboxes (not all of the folders).
  2. Removed the master password.
  3. Copied the "Profiles" and "profiles.ini" file from Windows into into "~/.thunderbird" on Linux.
  4. Replaced file paths in "~/.thunderbird/prefs*.json" and removed lines containing "[ProfD]".

FYI: Right after moving the profile and starting Thunderbird, it shows many empty "INBOX-<number>" folders and some duplicate inboxes with different amounts of e-mails in them.These inboxes existed on the file system beforehand but were not shown in Thunderbird on Windows. I did not show these here.

FYI: The e-mails are still present on the servers.

Thank you for any assistance you can provide!

tanstaafl
Moderator

User avatar
 
Posts: 45784
Joined: July 30th, 2003, 5:06 pm

Post Posted July 13th, 2019, 10:07 am

Step 4 is probably the culprit. Thunderbird tries relative paths before absolute paths, so usually you can move between windows, Linux and OS X without problems. Unfortunately you removed all of the relative paths. So its using absolute paths that are invalid due to their following Windows syntax conventions. Normally you should use the profile as is, but if you were going to remove settings with paths it should have been the absolute ones.

From my prefs.js file:

user_pref("mail.root.imap", "C:\\Users\\Eric\\AppData\\Roaming\\Thunderbird\\Profiles\\w0p7q3aa.default\\ImapMail");
user_pref("mail.root.imap-rel", "[ProfD]ImapMail");
user_pref("mail.root.none", "C:\\Users\\Eric\\AppData\\Roaming\\Thunderbird\\Profiles\\w0p7q3aa.default\\Mail");
user_pref("mail.root.none-rel", "[ProfD]Mail");
user_pref("mail.root.pop3", "C:\\Users\\Eric\\AppData\\Roaming\\Thunderbird\\Profiles\\w0p7q3aa.default\\Mail");
user_pref("mail.root.pop3-rel", "[ProfD]Mail")

notice how [ProfD] is for the relative path.

I have a prefs.js file containing the settings and my profile is used by both 60.8.0 and 68.b3. I've never heard of a prefs*.json file. panacea.dat is the file that caches known folders. What is the full name of prefs*.json?

sfhowes
 
Posts: 450
Joined: April 1st, 2012, 10:21 am

Post Posted July 13th, 2019, 10:48 am

Related to the issue with file paths, having to re-enter the passwords is probably due to not deleting the pkcs11.txt file in the profile when you copied from Windows to Linux. That may have affected the authentication when you restarted and folders appeared empty. If the mail is still on the IMAP server, you should set the gmail authentication to OAuth, enter the normal account password, and allow the OAuth process to complete.

You may have several files such as prefs-1.js, prefs-2.js, prefs-3.js etc., all of which are old versions of prefs.js, the only important version.

This would have been a lot simpler if you had deleted the Thunderbird folder on the Linux computer, copied the Thunderbird folder from Windows into the same location, and deleted pkcs11.txt.

sldayo
 
Posts: 4
Joined: July 13th, 2019, 5:00 am

Post Posted July 14th, 2019, 6:36 am

sfhowes wrote:Related to the issue with file paths, having to re-enter the passwords is probably due to not deleting the pkcs11.txt file in the profile when you copied from Windows to Linux.


I have followed your suggestions and suddenly things are working much better! After deleting "pkcs11.txt", authentication works without re-entering passwords, and e-mails show up! The password manager is no longer bricked.

There are some exceptions where e-mails do not appear, probably because I removed some "app passwords" which caused authentication to stop working for some accounts. However, I fixed that (switched to OAuth) back on Windows and migrated to Linux again, and e-mails appeared. :D

Thank you the help!

tanstaafl wrote:So its using absolute paths that are invalid due to their following Windows syntax conventions. Normally you should use the profile as is, but if you were going to remove settings with paths it should have been the absolute ones.
[...]
I've never heard of a prefs*.json file. panacea.dat is the file that caches known folders. What is the full name of prefs*.json?


I replaced the paths with the Linux equivalent paths, e.g. "/home/<user>/.thunderbird/..." and replaced the directory separators carefully.

I saw a guide that said to remove the relative paths since they will be regenerated.

I have a "prefs.json" file as well as a "prefs-1.json" file and I assumed everyone understood that "prefs*.json" meant all files matching this pattern. Sorry about that!

tanstaafl
Moderator

User avatar
 
Posts: 45784
Joined: July 30th, 2003, 5:06 pm

Post Posted July 14th, 2019, 3:21 pm

I understood what you meant by the wild card. However, I don't have a prefs.json file. I have a prefs.js file instead. I also checked that my copy of Firefox 68.0 doesn't have a prefs.json file (thinking maybe you were using a Thunderbird daily build). One of the reasons why I am asking is I try to keep http://kb.mozillazine.org/Files_and_fol ... hunderbird uptodate.

Any idea why you have a prefs.json file?

Are you using a Mozilla build or one provided by Ubuntu?

sldayo
 
Posts: 4
Joined: July 13th, 2019, 5:00 am

Post Posted July 15th, 2019, 3:02 am

tanstaafl wrote:I don't have a prefs.json file.

Oops... I did not double-check the name before writing the initial post and then just kept writing ".json". Then I guess I just kept ignoring the file extension since I "already knew" it was ".json". It is actually ".js". Sorry for the trouble. ](*,)

tanstaafl
Moderator

User avatar
 
Posts: 45784
Joined: July 30th, 2003, 5:06 pm

Post Posted July 15th, 2019, 9:17 am

Not a problem :)

Return to Thunderbird Support


Who is online

Users browsing this forum: No registered users and 11 guests