10

I reinstalled Firefox, because my profile was crashing. I backed up my ~/.mozilla folder to some other place, uninstalled firefox and installed it again. New firefox wasn't crashing. So I copied one of my backup up old profile to new firefox, and that profile was crashing again.

Now, I would like to use completely fresh profile and copy only the things that I need from the old profile that is crashing. Which files need I to replace? I need bookmarks (the quick access bar with bookmarks is sufficient for me and I need all the extensions with extension data). What could I also need and forget? I want to try it, I will at least find out, if it is some extension that's causing the crashes. But, I think it is not. It starts usually when I open a new tab and the page won't load.

My OS is Lubuntu 18.04.6 LTS. Firefox version is 112.0.2 32 bit

1 Answer 1

5

You don't need to reinstall Firefox if the system files are not corrupted or damaged.

Firefox Safe Mode

You can also start Firefox in the safe mode, so the extensions are disabled.

Firefox Safe Mode is a troubleshooting mode that temporarily disables all extensions, themes, and custom settings in Firefox and starts the browser with default settings. It is designed to help you diagnose and fix problems with Firefox, such as performance issues, crashes, or problems with add-ons.


Firefox profiles with firefox -p

You can start your Firefox with firefox -p. Now you get a new popup window where you can create, delete or rename profiles for Firefox. Just unmark Use the selected profile without asking at startup, and after that every time Firefox start's you can select the profile you wanna work with.

You can create different profiles for different use-cases:

On my Debian gnu/linux the config files are in ~/.mozilla/firefox/. You can copy or backup the profiles from there. The starts with varchar+name like 5v96ky6z.AI but you can rename them, and you can copy and start them from another disk, USB, sshfs/fuse, samba share, nfs, etc..

If you want to know what path firefox is using for your current profile you can check this with about:profiles or about:support in the url bar.

No matter how Firefox is installed, via a package manager, Snap, Flatpak, or otherwise, or where the profile is stored, this will always show the correct profile path.

If you rename and move the folder you need to edit the profiles.ini, in my case the ~/.mozilla/firefox/profiles.ini. You have different blocks for each profile that looks like this:

[Profile0] Name=MENU_NAME IsRelative=0 Path=/home/USER/FOLDER_NAME Default=1 
  • Default=1 You only have this once in the file for only one profile, you can delete this it is not absolutely necessary
  • Default is the standard profile that will start if Use the selected profile without asking at startup is selected
  • Name=MENU_NAME The name for your selected profile in the menu list
  • Path=/home/USER/FOLDER_NAME The path and the folder name of your profile

You can use a relative or an absolute path, you can use IsRelative=0/IsRelative=1:

[Profile1] Name=USERNAME2 IsRelative=0 Path=/MYPATH/FOX2 

The name of the selected user Name=USERNAME2 and the name of the folder Path=/MYPATH/FOX2 do not have to be the same

You can add or delete your profiles entries from the backup. Don't forget the enumeration of the number must always take place in the order: [Profile0], [Profile1], [Profile2], but in the file the arrangement can be messed up not in the order: [Profile2], [Profile0], [Profile1].

You can't have [Profile0], [Profile1] and [Profile3] without and existing a dummy-entry or profile named [Profile2].

If you start Firefox and the menu is empty, you may have a syntax error or you might encounter a permission error when using symlinks to directories, for example due to sandboxing in Flatpak.

Firefox through Flatpak, profiles, symbolic link...

Backup profile files

These are the files I do my backup logins, bookmarks, without the extensions or others:

  • places.sqlite
  • logins.json
  • logins-backup.json
  • key4.db

places.sqlite is the storage for the bookmarks

For the quick access bar with bookmarks, for your session search for the folders sessionstore or sessionstore-backups or the files sessionstore.jsonlz4

Or you backup the whole profile folder, in my case for profile 5v96ky6z.AI ~/.mozilla/firefox/5v96ky6z.AI.

prefs.js and user.js

In Firefox, settings and custom configurations are stored in the profile folder in prefs.js and user.js.

The prefs.js file contains all current user preferences (like homepage, privacy options, installed add-ons). It’s automatically created and updated by Firefox

The user.js file is optional and lets you set permanent custom preferences Firefox reads it at startup and overwrites corresponding values in prefs.js


Firefox Sync

You can also link your firefox profile to an email and thus synchronize everything between different firefox instances or computers.


Addons & Extensions|xpi(Cross-Platform Install) package/file

In the profile path ~/.mozilla/firefox/5v96ky6z.AI/extensions in the folder extensions there are the {--ID--}.xpi packages, every add-on is a {--ID--}.xpi with an ID you can open a package with double-click and you can see all the files that belongs to an add-on example: {b9acf540-acba-11e1-8ccb-001fd0e08bd4}.xpi.

In the manifest.json file you get all the information about that selected add-on, like description, version. etc.

You can copy this add-on to your new/selected profile by right mouse click open as then select Firefox start the profile you want to install to or select open file from your firefox menu and you can easily install that add-on from this package

You can also see the extensions if you start about:config in Firefox as URL and search for extensions.webextensions.ExtensionStorageIDB.migrated.

If you start about:support scroll down, and you will find in the Add-ons area the Addon name for the {--ID--}.xpi package ID

There are also 3 files in the profile path ~/.mozilla/firefox/5v96ky6z.AI/ where you can find other information about the search-engines, settings, etc..:

  • extension-preferences.json
  • extensions.json
  • prefs.js

Maybe you need the addonStartup.json.lz4 file, I did not backup that.

In the storage directory you will find a subfolder for each installed add-on but some add-ons, maybe store the data in a different location/directory in your profile path.


Cookies and other storage mechanisms

In recent versions of Firefox, the cookie storage location in Linux has been changed.

The cookies now stored in a format called cookies.sqlite within the Firefox profile directory.

~/.mozilla/firefox/YOURPROFILE/cookies.sqlite

YOURPROFILE, if you are using more then one profile, otherwise it's something with default.

If using snap you will find the cookie file in ~/snap/firefox/common/.mozilla.

Check this too, for other storage mechanisms and experimental technology:

There are other storage mechanisms for cookies in recent versions, such as IndexedDB and the HTTP cookies storage API. Check the Browser compatibility table carefully before using this in production.


Storage Inspector

You can use the Storage Inspector to inspect the cookies and other types of storage used by the current tab.

The Storage Inspector enables you to inspect various types of storage that a web page can use. Currently it can be used to inspect the following storage types:

  • Cache Storage — any DOM caches created using the Cache API.

  • Cookies — All the cookies created by the page or any iframes inside of the page. Cookies created as a part of response of network calls are also listed, but only for calls that happened while the tool is open.

  • IndexedDB — All IndexedDB databases created by the page or any iframes inside the page, their Object Stores and the items stored in these Object Stores.

  • Local Storage — All local storage items created by the page or any iframes inside the page.

  • Session Storage — All session storage items created by the page or any iframes inside the page.


What else

  • Check if there is an addon for your firefox version available to export/backup your addons

Backup with terminal and bash

You can write a bash script to backup all the files you need, with cp or rsync and/ or create a tar file


Write your on addon/xpi (Cross-Platform Install)

How do I create an add-on for Firefox?

Open the about:debugging page, click the This Firefox option, click the Load Temporary Add-on button, then select any file in your extension's directory. The extension now installs, and remains installed until you restart Firefox.

8
  • Thank you. You forgot only, how to safely copy extensions from one profile to another? Commented May 12, 2023 at 19:49
  • 1
    @xralf | i will be back later than i will add more information... max 1 hour ^^ Commented May 12, 2023 at 20:00
  • 1
    So, it's not possible to simply copy the extensions from command-line? I'm using i3 window manager, which file manager you suggest to use when it is not possible do it command line? Commented May 12, 2023 at 22:14
  • And another thing. I'd like to copy the data associated with the extensions as well. For example I'm using Element Blocker, SiteDelta watch, Adblock Plus and they have some data associated with them and I'd like to transfer them to new profile as well. Commented May 12, 2023 at 22:22
  • 6
    You can copy all files you need from the terminal, i use a bash script with cp or rsync for my ff backup Commented May 12, 2023 at 22:26

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.