Backing up and restoring bookmarks - Firefox

From MozillaZine Knowledge Base
Revision as of 21:27, 3 December 2010 by Alice Wyman (talk | contribs) (Intro changed to :''This article applies to Firefox 3 and above.'')
Jump to navigationJump to search
This article applies to Firefox 3 and above.

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.

Difference between restoring and importing bookmarks

When you restore a bookmark backup file, it replaces your existing bookmarks with the contents of the backup file. This will remove your existing bookmarks. Starting in Firefox 3, Firefox includes a bookmark Backup and bookmark Restore feature, in addition to the export bookmarks and import bookmarks features found in all Mozilla browsers. All bookmark backup files created and used in Firefox 3.0 and above are in JSON format. The backup file can be one of the bookmark backups that Firefox creates automatically or it can be a backup file you've created yourself.

When you import a bookmarks HTML file, its contents are added to your existing bookmarks. If you want to add bookmarks from another Firefox installation to your existing bookmarks, you must first have a bookmarks HTML file. (You can create a bookmarks HTML file by exporting your bookmarks.) You would then use the Firefox Library window's Import HTML feature (not the "Restore" feature). The file you import must be in HTML format. Similarly, if you want to add bookmarks from Firefox 2 or another browser into Firefox 3, or if you want to move your Firefox 3 bookmarks to another browser, you must use the Import HTML and Export HTML features.

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, 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] If you see the error, Unable to process the backup file, read this article.

Note: You may also be able to restore your bookmarks by removing the file places.sqlite from the Firefox profile folder, as explained here, but 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 ("Bookmarks -> Organize Bookmarks") 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 ("Bookmarks -> Organize Bookmarks"), 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 ("Bookmarks -> Organize Bookmarks"), 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.