Migrating Extension storage.local Data to A New Profile (IndexedDB) Manually

This is a lot of work if you have to do it frequently, but for emergency use:

Step 1: Extract the data to JSON format and save as a file

In Firefox running in the source profile:

(A) Open about:debugging and click Debug for the extension

(B) In the remote debugging window, click the Console tab, then execute this script:

browser.storage.local.get(null).then(data => {console.log(JSON.stringify(data))});

(C) Right-click the output and Copy object

(D) Paste into your preferred text editor and save as storage.js

Step 2: Position the data for migration in the destination profile

(A) Open the profile folder that will receive the data

(B) If there is not a browser-extension-data folder, create one

(C) In the browser-extension-data folder, create a folder whose name exactly matches the Extension ID on the about:debugging page of the source Firefox

(D) Copy the storage.js file into that new folder

Step 3: Migrate Data in Destination Profile

Hat tip: New backend for storage.local API

(A) Open Firefox in the destination profile

(B) Optionally open the Browser Console to monitor for migration message(s)

(C) Install the extension, and it should automatically migrate from storage.js to IndexedDB; storage.js will be renamed to storage.js.migrated

1 Like

Note that this potentially loses some data since storage.local can contain things like regexp literals which is why it was stored as a js file.