You are not logged in.

#1 2026-01-24 02:46:54

Brocellous
Member
Registered: 2017-11-27
Posts: 161

Migrating Firefox to xdg base dirs?

Firefox 147.0 release notes claim it now supports XDG base dir spec:

mozilla wrote:

Firefox now supports the Freedesktop.org XDG Base Directory Specification.

But the default behavior is to use the legacy .mozilla directory, if it exists.

Has anyone migrated firefox to the new spec, and could share a way to do it that preserves my browser profile and browsing session? Thanks.

Offline

#2 2026-01-24 03:45:28

stanczew
Member
Registered: 2021-03-02
Posts: 107

Re: Migrating Firefox to xdg base dirs?

Close Firefox, then (assuming default XDG dirs):

mv ~/.mozilla ~/.config/mozilla

And of course it's a good idea to have a backup in case anything goes wrong.

Offline

#3 2026-01-24 04:01:07

Brocellous
Member
Registered: 2017-11-27
Posts: 161

Re: Migrating Firefox to xdg base dirs?

What about the cache, shared data, and state directories? Firefox is a complex application that could conceivably use all of those, but those functions previously were all ensconced in the mozilla dir.

Is it really accurate for 147 to just mv .mozilla to .config/mozilla?

Offline

#4 2026-01-24 04:25:37

stanczew
Member
Registered: 2021-03-02
Posts: 107

Re: Migrating Firefox to xdg base dirs?

Why don't you try it yourself? Rename/move your current .mozilla directory, launch Firefox so that it starts a fresh profile, and see which XDG directories it actually uses.
Spoiler: it's .config and .cache, but .cache was used for a long time already. So in effect the "XDG Base Directory Specification support" is just an alternate path for the main .mozilla directory; no split of shared/state data was implemented.

Actually, it seems the migration is not officially supported:
https://bugzilla.mozilla.org/show_bug.cgi?id=259356

(…) there is no migration path supported at this point: only new profiles are expected to use the new setup. Migrating manually is at your own risk, make a backup before.

I just simply moved the directory and had 0 issues, but of course YMMV.

Offline

#5 2026-01-24 17:36:14

xerxes_
Member
Registered: 2018-04-29
Posts: 1,002

Re: Migrating Firefox to xdg base dirs?

You can go in address bar to about:support and see what directories are used for config (at the begining of page) and for cache (at bottom of page).
When (and if) you move your .mozilla directory to .config you can see there if it's used.
BTW I read somewhere in mozilla bugzilla that some firefox addons may not support new XDG .config/mozilla directory and don't work.
I will stay with old dir as long as I can.

Last edited by xerxes_ (2026-01-24 17:37:33)

Offline

#6 2026-01-24 19:55:47

Brocellous
Member
Registered: 2017-11-27
Posts: 161

Re: Migrating Firefox to xdg base dirs?

stanczew wrote:

Actually, it seems the migration is not officially supported: https://bugzilla.mozilla.org/show_bug.cgi?id=259356

That bug also has a comment that suggests using firefox Sync:

:gerard-majax wrote:

The preferred way to move to the new behavior would be to ensure Sync is setup, get rid of the legacy directory (make a backup just in case) and starting again the browser. A new profile should be created in the XDG_CONFIG_HOME hierarchy and then you can bring back things.

I tried this and it reinstalls some extensions, but can't seem to restore my browsing session with synced tabs, unless there's something more I need to do to re-open those tabs. I'll try again later and see if I can get it to work.

Offline

Board footer

Powered by FluxBB