sodcalculator

10 Tech How-To

How to Backup Firefox History

Guide 10-42403 · Updated · Step by step

Backing up your Firefox history protects your browsing data from accidental loss when switching devices, reinstalling the browser, or troubleshooting issues. This guide shows you how to export your history to an HTML file or copy the underlying database, and how to restore it later. You’ll need access to your Firefox profile folder and, for the HTML method, a working Firefox installation.

What You’ll Need

  • A computer with Firefox installed (for the HTML export method).
  • File Explorer (Windows) or Finder (Mac) to locate your profile folder.
  • Optional: A USB drive or cloud storage to store the backup file.

Step-by-Step

Method 1: Export History as HTML (Recommended for portability)

  1. Open Firefox on your computer.
  2. Click the library icon (books) in the toolbar, or press Ctrl+Shift+H (Windows/Linux) or Cmd+Shift+H (Mac) to open the Library window.
  3. In the Library window, click Import and Backup in the toolbar.
  4. Select Export History to HTML… from the dropdown menu.
  5. Choose a location to save the file (e.g., Desktop or Documents), give it a name like firefox-history-backup.html, and click Save.
  6. Your entire browsing history is now saved as an HTML file that can be opened in any browser or imported back into Firefox later.

Method 2: Copy the Places Database (Full Backup)

  1. Close Firefox completely (all windows, including background processes).
  2. Open your Firefox profile folder:
    • Windows: Press Win+R, type %APPDATA%\Mozilla\Firefox\Profiles\, and press Enter.
    • Mac: Open Finder, press Cmd+Shift+G, type ~/Library/Application Support/Firefox/Profiles/, and press Go.
    • Linux: Navigate to ~/.mozilla/firefox/ in your file manager.
  3. You’ll see one or more folders ending in .default or .default-release. Open the one that matches your main profile (usually the one with the most recent modification date).
  4. Locate the file named places.sqlite. This file contains your entire browsing history, bookmarks, and visit metadata.
  5. Copy places.sqlite to a safe location (external drive, cloud folder). For extra safety, also copy the places.sqlite-wal and places.sqlite-shm files if they exist.
  6. To restore, close Firefox, replace the places.sqlite in the profile folder with your backup, and restart Firefox.

Method 3: Sync with a Firefox Account (Automatic)

  1. Click the menu button (three horizontal lines) in the top-right corner.
  2. Select Sign in to Sync (or Sync and save data).
  3. Follow the prompts to create or sign in to a Firefox Account.
  4. In the sync settings, ensure History is checked (it’s usually enabled by default).
  5. Your history is now continuously backed up to Mozilla’s servers and can be restored on any device by signing in.

Common Mistakes

  • Not closing Firefox before copying the database. If Firefox is running, places.sqlite may be locked or corrupted when copied. Always close Firefox completely first.
  • Copying the wrong profile folder. If you have multiple profiles, you might back up an old or unused one. Check the profile’s modification date or look for the one with your recent bookmarks.
  • Overwriting the wrong file during restore. When restoring, make sure you replace the places.sqlite in the correct profile, not the default one.
  • Assuming the HTML export includes passwords or open tabs. The HTML export only contains history and bookmarks, not cookies, passwords, or session data.

Tips

  • Schedule regular backups: set a reminder to export your history to HTML monthly if you rely on it for work or research.
  • Combine methods: use Sync for automatic cloud backup and occasionally export to HTML for a local, portable copy.
  • Compress the places.sqlite backup into a ZIP file to save space and keep related files together.
  • If you’re migrating to a new computer, use the HTML export to import history into Firefox on the new machine, or simply copy the entire profile folder for a full transfer.

Troubleshooting

  • Export to HTML fails or produces an empty file: Try restarting Firefox in Safe Mode (help menu → Restart with Add-ons Disabled) and export again. If that works, a corrupt extension is the cause.
  • Copied places.sqlite doesn’t show history after restore: Firefox may have created a new places.sqlite since the backup. Close Firefox, delete the current places.sqlite (and its -wal/-shm files), then paste your backup. Start Firefox and check.
  • History appears but bookmarks are missing: The HTML export includes bookmarks, but if you used the database method, ensure you restored the entire places.sqlite file, not just part of it.
  • Sync doesn’t show history on another device: Go to Sync settings and click Sync Now. Also verify that the device is signed in with the same account.
  • Can’t find the profile folder: In Firefox, type about:support in the address bar and press Enter. Look for the Profile Folder row and click Open Folder (Windows) or Show in Finder (Mac).

Frequently Asked Questions

Does the HTML export include passwords?

No. The HTML export only includes history and bookmarks. Passwords are stored separately in logins.json and are not part of the HTML backup.

Can I restore history from the HTML file?

Yes. In the Library window, go to Import and Backup → Import History from HTML… and select the file. It will merge the imported history with your existing history.

Will copying places.sqlite also back up my bookmarks?

Yes, places.sqlite contains both history and bookmarks. That’s why it’s a full backup.

How often should I back up my history?

If history is important to you, a monthly backup is a good rule. If you use Firefox Sync, it’s continuous.

Can I back up history on my phone?

Firefox for Android and iOS don’t allow direct file access to the history database. Use Sync to back up mobile history to your Firefox Account.

Is there a way to export history to CSV or Excel?

Firefox doesn’t have a built-in CSV export for history. You can use the HTML export and then convert it to CSV using a spreadsheet program or a third-party tool.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →