Firstly, note that there's good reason a Firefox Refresh removes your extensions and preferences - these are usually the most likely cause of problems like slowness and bugs encountered in Firefox.
This means that Refreshing Firefox and immediately restoring everything from your old, affected user profile may leave you with a refreshed profile that suffers from the same issues. Therefore, if you can afford the inconvenience, building Firefox from scratch all over again is a more superior, leaner option to importing old data.
That said, a Refresh once all of your data is backed up can't hurt, and can be the quickest method for eliminating problems. If, after restoring your old data after a Refresh, you still notice the same problems occurring, simply try another Refresh without copying the data, or by copying it pieces at a time, so as to isolate the true cause of the issues.
Backing up your Firefox profile
A Firefox Refresh creates a brand new user profile with only the most essential data, and by default, moves your old user profile (and with it, all of your data) to a folder called Old Firefox Data on your Desktop. This will almost always be sufficient, but just in case this folder isn't created, you can go ahead and create a secondary backup by following the steps below.
You'll need to navigate to the folder where your current Firefox profile is stored. To do this, click Help > Troubleshooting Information from the Firefox menu bar. Look for the Profile Folder field under the Application Basics header, and click Open Folder.
In the folder that opens, make a note of the name of the user folder that you're in, then use your file manager to go one directory up. Here, there'll be two or more folders - one for each of the user profiles that currently exist for your installation of Firefox, plus a default one. Often, if you've had Firefox for a reasonably long time, it can accumulate several user profiles. Copy the user folder you were previously in to your Desktop or somewhere else inside of your user folder to back it up.
Follow the instructions here to Refresh Firefox.
Once the Refresh has completed, Firefox will tell you what was imported. This should include your:
- Bookmarks (stored in the
- Browsing and download history (stored in the
- Passwords and logins (stored in the
- Open windows and tabs (stored in the
- Cookies (stored in the
- Web form auto-fill information (stored in the
- Personal dictionary (stored in the
Everything not seen above will now be lost. If you've spent a decent amount of time customising your browsing setup, Firefox will now feel noticeably unfamiliar.
Restoring old extensions, preferences and data
You'll need to restore everything else for Firefox to behave like you expect it to again.
Navigate to your Desktop. If you see a folder called Old Firefox Data, you won't be needing the secondary backup of your user profile that you created earlier, and can safely delete it. Open the Old Firefox Data folder, and then the only user profile folder inside of it. You should now be looking at the full contents of your previous Firefox profile.
Now you'll need to navigate to the user profile newly created by the Refresh.
Open Firefox, and from the Menu Bar, click Help > Troubleshooting Information. In the Window that opens, click Open Folder next to the Profile Folder field.
You'll now need to transfer files and folders as needed from the old user profile in Old Firefox Data to this new one being used by Firefox.
What you copy over depends on what data you want to restore from your old profile. Key files and folders that contain data not already preserved by the Refresh are shown below.
The bookmarkbackups folder contains daily backups of bookmarks automatically created by Firefox, up to a maximum of 15 backups. Copy this folder if you expect to restore bookmarks from the last few weeks.
The browser-extension-data and extension-data folders contain the the data stored and used by extensions. I imagine a lot of, if not most, browser extensions would be pretty much useless without the data stored in these folders, so if you're planning to preserve extensions you should probably preserve these folders.
The chrome folder contains the userChrome.css file. Unless you've edited your userChrome.css and you want to keep the edits you've made, you don't need to copy this folder. Note that "chrome" here, and elsewhere in the inner workings of Firefox, refers to the term browser chrome, not Google Chrome.
The content-prefs.sqlite and permissions.sqlite files store Firefox permissions, such as which sites are allowed to display popups, or any custom zoom levels that have been set on sites.
The extensions folder contains all extensions installed for Firefox, including those marked as legacy after Firefox 57 (Quantum).
The handlers.json file stores preferences that tell Firefox what to do when it comes across a particular type of file, such as opening a PDF file with Acrobat Reader when you click on it.
The prefs.js and user.js (if present) files contain the bulk of user preferences, including any Firefox Options settings stored.
The search.json.mozlz4 file stores any custom search engines you've added to the Firefox Search bar.
The xulstore.json file stores toolbar and window size/position settings.
Ensuring Firefox is closed, copy any of the above as needed - using Shift + Click to select multiple items at once - paste them into the new Firefox user profile, and confirm any overwrites or merges when prompted.
Once done, and Firefox is re-opened again, it should look and behave exactly as it did before the Refresh - hopefully without the bugs that necessitated it in the first place.
References and Further Reading