Can't restore firefox settings with .mozilla backup


I have a feeling that the answer to this is something reeally basic and embarrassing. I’m not a “real” tech person, I’m a translator by trade, but this is one of my favourite features in Linux, and I’d love to get it working so here goes…

Recently (couple of weeks?) when installing a new distro I haven’t been able to restore the Firefox or Thunderbird settings by copying the .mozilla and .thunderbird directories from my backup to the home directory of my new install. It used to work like a charm and was such an awesomely easy way to move your settings to another machine/install. Has it changed somehow? When I start Firefox, it’s always a “fresh version” without my bookmarks or other settings. I’ve tried it on several distros and machines. Help?

I have an up to date Firefox and Thunderbird in Debian.
Here is what my dot files look like

nevj@mary:~$ ls -l .mozilla
total 12
drwx------ 2 nevj nevj 4096 Jan 28  2021 extensions
drwx------ 6 nevj nevj 4096 Jan 28  2021 firefox
drwx------ 2 nevj nevj 4096 Jan 28  2021 systemextensionsdev
nevj@mary:~$ ls -l .thunderbird
total 24
drwx------ 13 nevj nevj 4096 Apr 19 21:57  6ozfwg4n.default-default
drwx------  3 nevj nevj 4096 Apr 19 19:59 'Crash Reports'
drwx------  2 nevj nevj 4096 Feb 15  2021  gainyiif.default
-rw-r--r--  1 nevj nevj   62 Feb 15  2021  installs.ini
drwx------  2 nevj nevj 4096 Feb 15  2021 'Pending Pings'
-rw-r--r--  1 nevj nevj  259 Feb 15  2021  profiles.ini

So do you have all those directories and files in the files you copied in?
My Firefox is 98.1.0esr(64-bit) Thunderbird is 91.8…0(64-bit)

I dont know of any recent changes in the way .mozilla or .thunderbird are arranged.

If yours are the same… you must have to do something to Firefox to get it to look at uploaded config files instead of starting out as a new user.


Here’s what I have
Screenshot from 2022-04-20 14-16-58

One folder is a bit different (“default-release”, not “default-default”) but basically I suppose they’re the same. Still, when I copied these to a USB stick and then to another machine, they don’t work. Weird.

I fiddle with my computers quite a bit and I’m not an expert, so I could have changed a lot of things to make things go wrong, I suppose. But shouldn’t this work?

Yes it should work… I have done it myself.
It is a mystery … the .mozilla and .thunderbird directories look very similar… even the file permissions look right.

What about permissions and ownership of the two directories?
I have

drwx------  5 nevj nevj   4096 Feb 24  2021 .mozilla

drwx------  5 nevj nevj   4096 Feb 27  2021 .thunderbird
drwx------  6 nevj nevj   4096 Feb 27  2021 .thunderbird.deb10.orig
drwx------  5 nevj nevj   4096 Feb 27  2021 .thunderbird.deb8

You can see I actually have some old ones there that I have copied. Check your permissions and ownership.

What else? There must be some way to tell firefox not to make a new startup?
Maybe what you need to do is move your files somewhere else, let firefox make a new startup, then overwrite its new .mozila directory with your old one.

I am guessing. Cant remember what I did. It was years back.


Ok, maybe I found something. If I go back a level to the “/media/janne/” directory and try to ls -l the USB it doesn’t list the .mozilla and .thunderbird folders. Is that normal? :slight_smile: Sorry, my Linux skills aren’t fantastic… Also, here are the permissions to the .mozilla folder. Group “janne” doesn’t have file permissions. Should it have?

Hi and welcome.

Yes, I saw in your first screenshot, that you seem to work/boot from a USB drive (/media/janne/USB-STICK)?
Do you start FF from there?

Use ls -al to show hidden files

Your permissions look OK

I looked around a bit.

  1. How did you copy the .mozilla directory?
    cp -r may not preserve everything
    they recommend cp --archive to preserve links and permissions
    or use tar

  2. It would seem the only bjt you really need from your old system is the firefox profiles. They are in
    so maybe you should just overwrite that bit after you let it start up.

It is quite annoying. All the firefox and thunderbird info refers to Windows. There is nothing relevant to Linux.


PS found this

As I change or experiment or upgrade distros, I usually bring my Firefox and Thunderbird settings with me by signing in. That’s the first item in the Firefox settings menu. UserID and password and whoosh! all the settings and bookmarks come flying in. Ditto Thunderbird.

Can’t really understand why yazm894 is having a problem, but I’ve probably forgotten to notice something.

Hi, thanks!

No, I have a Machine A from which I want to move my .mozilla and .thunderbird settings to Machine B. I copy them to a USB stick, stick that into Machine B and copy (or paste) them into the home directory. It’s worked for years, but now for some reason it doesn’t. I made a screenshot of the directories on the USB because I thought something odd might happen at that point.

The distros on which I copy the settings directories are also pristine, ie I haven’t touched anything on them usually, copying my Firefox settings is pretty much the first thing I do.


Thanks, I need to try archiving the files first. Although just copy-pasting them has worked for years… So strange…

Thanks, everyone!

Did you lookat
ls -al
of the .mozilla file
in the home directory of the new machine?

You need to check its permisssions, as well as the permissions of its contents


Ok, got the Thunderbird settings working. I logged out of Firefox Sync on all my devices. Maybe that has something to do with the whole kerfuffle. I seem to recall that I started using Firefox Sync around the same time that this problem started. I just couldn’t connect the two… I had a feeling that the solution would be something fairly obvious… :slight_smile: Although Firefox Sync shouldn’t affect Thunderbird settings, should it?

So basically I should have just signed in like berninghausen suggested. Or alternatively log out of Sync if I want to keep a local copy of the settings.

Sorreee guys I’m an idiot. :slight_smile: And thanks.

Well thank you, I did not know about sync or signing in.
Showing my age
Main thing is , you got it working.

Right… Spoke/wrote/apologized/rejoiced too soon. Firefox settings don’t work, although I can migrate the .thunderbird settings.

While logged out of Firefox Sync deleted the .mozilla directory and opened up a new Firefox, opened a few windows and changed a few settings. After that copied the .mozilla directory to a new machine. No joy. Aaaargh.

Maybe this copy of the .mozilla folder has been written over too somehow while I’ve fiddled with Firefox Sync.

Oh well, if I can’t get it to work, I’ll just sign in to Firefox Sync. It’s actually pretty cool.

It may be thst inside the .mozilla folder there are links or lock files that did not copy properly. Two options

  1. Try the copy using tar
    How to Backup and Restore Firefox Profile On Linux

  2. Let firefox set up its own .mozilla directory, then just overwrite the profile part of it which is in .mozilla/firefox

Dont give up

Neville and yazm894: I’m probably showing my ignorance, but I think of my browser and email life as conducted on the respective cloud servers. All of my Thunderbird email is stored on the Thunderbird server and my Firefox settings/bookmarks live on the Firefox cloud server, just as my id/passwords are stored on the Bitwarden server. When I load a new distro for an extended trial, I install Bitwarden in Firefox to access that information, then sign in to Firefox Sync and watch all of my Firefox data populate the program. Opening Thunderbird accesses my saved/archived and current mail from the Thunderbird server. Then I import my calendar and contacts files from their storage location on my external hard drive. In 15 minutes, my new distro has all I need to do anything I usually do, less the new applications I hoped to find in the new distro.
Seems pretty simple to me.

Yes Bill,
If you use the builtin tools in firefox and thunderbird there should be no issue.
If you want to do it the Linux way, by moving files around, it seems you have to do a bit of fiddling.
It would seem that mozilla do not really care about following the principles of Unix, they just provide inbuilt tools to do things their way.

Acknowledged, I go with the Mozilla flow for accuracy and consistency. However, exporting calendar and contacts frequently to my local external drive creates a backup that I can use outside the Mozilla world when a distro comes equipped with Evolution or a different PIM. I can also export my Firefox bookmarks and use them in a different browser, although Firefox is my browser of choice for security reasons.

Following the principles of Linux and Unix can be a desirable intent, but practically less than useful when there is a secure and more simple way to get the job done. Adherence to FOSS principles to the exclusion of using Occam’s Razor seems to me to be a rabbit hole practice. I try to avoid those by making secure decisions and avoiding Google and Chrome.

BTW, Protonmail is developing into a very useful provider of practical, secure solutions.

Opening Thunderbird accesses my saved/archived and current mail from the Thunderbird server.

But you still have to create a new e-mail account on Thunderbird and put in the mail server settings and everything? Or not?

I have a couple of bash scripts which regularly copy the .mozilla and .thunderbird folders to backups. Just basically a queue of rsync terminal commands. And another bash script which copies everything back when I try a new distro. And in the past it’s worked great: all the pages on Firefox I had open when I used it last just pop up, all the mail settings are there and all the spam rules and downloaded e-mails and everything. Like magic. Linux magic! Although just logging into Firefox is faster, I suppose.

I like having a “physical” copy of the stuff on my machines, but I’m a little tempted to move to Firefox Sync too. I’m just a little suspicious of the cloud stuff, although Mozilla and Bitwarden are very trustworthy companies. Maybe showing my age a little… :slight_smile: