12

I have the problem, that my backup is flooded by mozilla's firefox' profiles. I have only one user with multiple profiles.

The thing is that firefox saves various data in sqlite files etc that just are updated. I use a rsnapshot-based backup approach: if a file has not changed it is hard-linked to the last version. So no storage is consumed. If the file on the other hand has changed it needs to be completely written to the backup. This causes the backup to increase rapidly although this is not always important data but caches etc. So I intend to exclude the temporary cached and other data from the backup.

Now I saw that the biggest block in the firefox profile folder that seems to have regular updates is the storage/default folder. Searching the internet I found this link. As far as I understand this, I can safely drop the files in the storage/default and storage/temporary folders in the backup. Firefox will recreate the content when I visit the pages again.

Is this correct? What sort of information is saved there (except for caches and temporary data)?

harrymc
  • 498,455

3 Answers3

6

The short answer is, yes, it's okay to drop that folder. But you need to decide if that's worth what you'll be "losing."

The folder contains the Cookies and local storage for each website.

  1. A great many sites in this folder will probably be sites you've only visited once and may never visit again. No loss at all.

  2. Other sites may be ones you use every day. You will be required to log back into each site, and it is very likely that you will lose any saved preferences, such as site settings. No great loss.

  3. A few sites may be ones that use local storage or indexed db storage that may (or may not) contain a large amount of your own saved data. For example, if you use any sophisticated "application" websites like Google Docs/Google Sheets, the folders will likely contain current data that you're actively using. Even so, in most cases, your data will still be saved by the website itself, so you won't really be losing much. Minor inconvenience at most.

  4. Add-on and Extension data. This is probably the only data in this folder that you don't want to lose. It will contain your settings and saved data for each extension and represents an actual loss of data, depending on the sophistication of the addons you use. Real, actual data loss. At this point, you need to take one of three paths:

    1. Easy but treacherous: Don't backup the folder, requiring you to set up your addons all over again if you need to restore your data in the future.
    2. Easy but larger backups: Back up the entire folder, as usual. But if you really wanted this, then you wouldn't be reading this page.
    3. Harder but best balance of data retention and backup size: Add each addon folder to your backup routine (that all begin with "moz-extension+++", being careful to add new folders when you add a new addon.
  5. There is exception you need to be aware of. If you are using a full-featured website app, such as an online image editor or an online game, then there's a solid chance that your data will be lost if you remove its associated folder. If this applies to you, you would very likely know it, and you can take steps to back up just that website's folder. But in reality, this will not apply to many people. I only mention it for the sake of complete clarity. Actual data loss, but not applicable for many people.

So in summary, unless you are a power user (i.e., use sophisticated addons), you can safely remove the data in this folder, or exclude the folder from backups. You will lose addon data if you don't take steps to specifically back those folders up, and you'll also lose minor website preferences, but in general, the result will be more of a minor inconvenience than anything else.

pbarney
  • 793
4

According to the Mozilla article Browser storage limits and eviction criteria:

  • <profile>/storage/temporary — temporary data storage repository
  • <profile>/storage/default — default data storage repository

The folder storage/default is where applications and webpages store their data, so losing it will mean that everything would need to be re-entered.

/storage/temporary seems to contain cookies and temporary stuff. Losing it may cause some problems, but less than storage/default.

harrymc
  • 498,455
0

I don't know if it was true at the time this question was asked, but modern Firefox seems to store each site's cache, local storage, and indexed database in separate sub-directories:

$ ls ~/.mozilla/firefox/<...>/storage/default/https+++www.youtube.com/
cache/
idb/
ls/
.metadata-v2

So, one can exclude just caches with a pattern like this:

~/.mozilla/firefox/*/storage/default/*/cache

I use this pattern for my daily backups, and when I did a test restoration, the browser started with no problems. Both extensions and history persisted, but I had to re-login to many sites.