After restoring a profile folder from backup, extension settings are lost
I just restored my $HOME/.mozilla folder from a backup (I closed Firefox, moved the old folder away, and the copied the backup folder to the correct location) and I noticed that while my bookmarks, logins, and extensions where correctly restored, all (?) settings from the extensions are lost. I had to reconfigure all custom uBlock origin filter lists, the Cookie Autodelete expression lists, the pwgen settings, and some others.
So to my question: since backing up the profile folder is obviously not enough to restore everything, is there some other folder or file I need to back up to retain the extensions settings on restore? Which one?
Thanks!
Wybrane rozwiązanie
5imon said
If settings use the localStorage api to store their prefs, does someone know where those get persisted on disk?
In Firefox 66+, it should be in a database under /storage in the profile folder.
In older versions, there was a JSON-format file under /browser-extension-data but it should have been migrated to databases. If you want to force a re-migration of older data, see:
https://blog.mozilla.org/addons/2018/08/03/new-backend-for-storage-local-api/
Przeczytaj tę odpowiedź w całym kontekście 👍 1Wszystkie odpowiedzi (11)
Some extensions use the Firefox settings file to store their data. Others create and use their own files.
What data is missing? What extensions? In the old folder, look for their names.
I would expect that if you restored the entire profile folder, all data would be available.
An exception might be if any of the path changed. I saw a discussion on Reddit, I think, where users observed that extension data paths were absolute instead of relative, which created problems for copying folders from one place to another.
FredMcD said
What data is missing? What extensions? In the old folder, look for their names.
all settings from at least these addos were lost:
- Cookie Autodelete
- uBock origin
- pwgen reloaded
- Custom user agent string
the livemarks addon settings were kept.
Zmodyfikowany przez 5imon w dniu
jscher2000 said
I would expect that if you restored the entire profile folder, all data would be available.
Yes me too, but apparently somehow this is not the case.
jscher2000 said
An exception might be if any of the path changed. I saw a discussion on Reddit, I think, where users observed that extension data paths were absolute instead of relative, which created problems for copying folders from one place to another.
No paths were changed. The firefox installation remained the same, I just restored the whole $HOME/.mozilla folder from a backup that was one hour old. When firefox started up again, everything was there, but all extensions were at default settings.
I really think there has to be something else stored somewhere. If settings use the localStorage api to store their prefs, does someone know where those get persisted on disk?
Zmodyfikowany przez 5imon w dniu
Wybrane rozwiązanie
5imon said
If settings use the localStorage api to store their prefs, does someone know where those get persisted on disk?
In Firefox 66+, it should be in a database under /storage in the profile folder.
In older versions, there was a JSON-format file under /browser-extension-data but it should have been migrated to databases. If you want to force a re-migration of older data, see:
https://blog.mozilla.org/addons/2018/08/03/new-backend-for-storage-local-api/
I see the storage.js.migrated file in the browser-extension-data folder for an extension, but if I look at the file storage/default/moz-extension+++xxxx.sqlite with sqlitebrowser, I see some tables, but no table contains the data the extension has saved. Is the data really there and I can not see it for some reason, or is the data saved somewhere else, and the sqlite db contains just some pointers?
5imon said
I see the storage.js.migrated file in the browser-extension-data folder for an extension, but if I look at the file storage/default/moz-extension+++xxxx.sqlite with sqlitebrowser, I see some tables, but no table contains the data the extension has saved.
These names are very messy:
/storage/default/moz-extension+++internal-UUID^userContextId=0123456789/idb/gibberish.sqlite
Within this database, the object_data table seems to contain the relevant stuff, but it needs to be deserialized back to text to be readable. (I looked into that in mid-March but I don't think I found a good tool for that. Somewhere I probably saw a Python script, but...)
How old is your backup? It seems that Firefox 66 added the userContextId to the folder names. Do you see different IDs on your folder names?
Thanks jscher2000, if you say the data has to be serialized back to text I am pretty positive the data is there. It's just not readable by me. So I think something strange happened and I will never know what. I hope the next time I have to restore things my addon settings will be there. I mark this as solved, even if I don't know what caused this.
5imon said
Thanks jscher2000, if you say the data has to be serialized back to text I am pretty positive the data is there. It's just not readable by me.
You should be able to see at least one row in the object_data table. I'm attaching an example of what I see for an extension I'm very familiar with. The values in the data column are unreadable to me, I need some kind of converter to know what it says.
(Corrected the keys in the image)
Zmodyfikowany przez jscher2000 - Support Volunteer w dniu
I have exactly the same problem. After resetting my profile, I was unable to recover uBlock Origin & NoScript, the versions for my Firefox 52.9 are no longer in the archive. There are files to transfer in the profile> extensions, but also in browser-extension-data > storage.js For uBlock Origin, it's also in extension-data > ublock0.sqlite But obviously, that's not enough for them to be functional, especially for uBlock Origin. I do not understand that Firefox does not let all its archives available, for those who are in this case, NoScript & uBlock Origin worked very well. It's disappointing, especially for these two protection addons
Hi Benjoin, we don't support Firefox 52 any more, and the Add-ons site doesn't support legacy extensions any more.
If you used Firefox's Refresh feature, your old profile folder with your extensions and data should be in a folder on your desktop named Old Firefox Data. I'm not sure whether you already tried to use those files, or that brought back the problem which caused you to use Refresh in the first place.