Backing up and restoring bookmarks - Firefox

From MozillaZine Knowledge Base
Revision as of 14:32, 20 November 2009 by Alice Wyman (talk | contribs) (→‎Import HTML: typo)
Jump to navigationJump to search
This article does not apply to Firefox 2 or below.

This article explains how to create and restore bookmark backup files in JSON format, as well as how to import and export bookmarks in HTML format, in Firefox 3.0 and above.

Note: These instructions require using the Library window "Import and Backup" button, which may not include a text label on Mac OS.

Creating bookmark backups

Firefox automatically creates daily rotating backups of your bookmarks. The five most recent bookmark backup files are stored in the bookmarkbackups folder, located in the Firefox profile folder. You can also create your own bookmark backups, by opening the Firefox Library window ("Bookmarks -> Organize Bookmarks"), clicking the "Import and Backup" button and selecting "Backup...". The Backup feature allows you to save a bookmark backup file (e.g., "Bookmarks 2009-05-22.json") to the location of your choice. Bookmark backup files are stored in JSON format and can be restored from the Library window of any Firefox installation, as shown below.

Restoring bookmarks from backup

You can replace your current bookmarks with a backup by opening the Firefox Library window ("Bookmarks -> Organize Bookmarks"), clicking the "Import and Backup" button (shown here on Windows) and using the "Restore" feature. You can select one of the five dated backups that Firefox automatically creates or you can use the "Choose File..." option to select another bookmark backup file, such as a backup you created yourself or one from the bookmarkbackups folder of another profile (see Profile folder - Firefox for profile location). If you choose your own bookmark backup file, it must be in JSON format (any bookmarks saved in HTML format, such as exported bookmarks, must be imported). [1] Note: If you see the error, Unable to process the backup file, read this article.

You can also restore your bookmarks by exiting Firefox and removing the places.sqlite file from the Firefox profile folder. Firefox will rebuild the Places database from the latest automatic JSON backup or, if no JSON file is found, from a bookmarks.html file, as detailed here; however, you will lose your browsing history.

Import and Export

Firefox and many other browsers allow you to import bookmarks from an HTML file and export bookmarks to an HTML file. In Firefox 3, this is done from the Library window using "Import HTML" and "Export HTML" in the "Import and Backup" menu.

Import HTML

Note: You may need to set your operating system to show files in hidden locations, if you want to import a bookmarks HTML file from another profile. On Windows, also make sure that file extensions are not hidden. See Show hidden files and folders for details.

To import a bookmarks HTML file, open the Firefox Library window (see above), click the "Import and Backup" button and select "Import HTML... -> from an HTML File". When the file picker appears, navigate to the folder that contains the bookmarks HTML file you wish to use and select that file. The "Import HTML" feature of the Library window will add the contents of any bookmarks file in HTML format to your current bookmarks. If you don't wish to keep your current bookmarks, start Firefox in Safe Mode, select the option, "Reset bookmarks to Firefox defaults", and choose "Make Changes and Restart", before importing the bookmarks HTML file.

Only files in HTML format can be imported. To replace your current bookmarks with a bookmark backup file stored in JSON format, you should use the "Import and Backup -> Restore" feature (see above).

Export HTML

You can also export your bookmarks to an HTML file by opening the Library window, clicking the "Import and Backup" button and selecting "Export HTML...". Name the file (bookmarks.html is the default) and select a location to save the HTML file.

Note: Due to a bug (fixed in Firefox 3.5) sometimes after using the Export HTML feature, no bookmarks HTML file is saved. You may be able to fix the problem by backing up your bookmarks to a JSON file and then restoring the backup file (see above). See Unable to export bookmarks to HTML file - Firefox for more information.