How to migrate installed Firefox (installed once from classic package) to snap. Latter one still not installed. Aimed goal: To have Firefox in snap app as well as unchanged user experience in Firefox after this migration is completed. Will it suffice to understand Firefox generic user data usage/local configuration as well as how snaps are working in general? In other words: Any specifics regarding Firefox machin-local/user configuration when Firefox is installed in snap (except snap framework specifics)?
The user configuration data of snap applications reside under the "snap" folder in your home folder. You can move your existing profile to the appropriate location so the snap folder has access to it.
A way to do that without risking to break anything is the following. Keep your current firefox installation for the time being.
Install the snap version of firefox
Or use any other method for installation if you prefer.
Run the snap version once.
You will now have two undistinguishable Firefox icons in your application overview. Run the snap version of firefox with the command:
This will create a default user configuration in the folder "firefox" under "snap" in your home folder.
** Quit any of your running Firefox instances **
Open the respective profile folders.
Open following folders in two file manager windows side by side. Turn "Show hidden filed" on.
/home/$USER/snap/firefox/common/.mozilla/firefox
/home/$USER/.mozilla/firefox
Here, $USER stands for your own login name.
Delete the newly created snap profile.
Under the SNAP folder, delete the profile folder you just created. It is named as
<random string>.default
, e.g.b0aix2sy.default
: the first part are random characters that are different for each installation.Transfer your profile to the snap version.
Copy your "normal" profile over from the NORMAL folder to the SNAP folder. It is named as
<random string>.default-release
. There will also be a folder with extensiondefault
. Leave that alone. It is thedefault-release
folder that contains your user data.Rename extension of copied profice
Rename the copied folder to change the extension from
default-release
todefault
. Copy the folder name to the clipboard.Update
profiles.ini
In the SNAP folder, open the file
profiles.ini
with text editor. On the linePath=<random number>.default
, change the folder name to the name of the folder you copied. Save the file and exit the editor.Now, when you start the snap installation of firefox, it will be configured as your current installation. If all is well, you can delete the folder
.mozilla
in your home folder and remove the regular version of firefox:sudo apt remove firefox
.For upgrade from 20.04 to 22.04
I found the accepted answer useful, but my experience on the LTS upgrade path was not quite the same.
This answer assumes that you gave the upgrader permission to migrate Firefox to snap. The upgrade had removed the
deb
version of Firefox and it had migrated (copied) all the profiles over but not included them inprofiles.ini
.So my solution:
/home/$USER/snap/firefox/common/.mozilla/firefox
it should contain your profiles which have been copied over from/home/$USER/.mozilla/firefox
. Those are the randomly named directories. If not them copy them over, the old location won't have been deleted./home/$USER/snap/firefox/common/.mozilla/firefox/
renameprofiles.ini
toprofiles.ini-bak
profiles.ini
from/home/$USER/.mozilla/firefox/
to/home/$USER/snap/firefox/common/.mozilla/firefox/
about:profiles
Unless you use multiple profiles, you'll probably only find two profiles in the
about:profiles
window, one will be new and blank, and the other will be the one you're looking for.