Your Firefox profile houses some pretty important stuff such as bookmarks, saved passwords and preferences which would be quite inconvenient to lose. As with any valuable data, your Firefox profile should be backed up regularly.

While you can always perform the backup manually or use an external tool (such as MozBackup or FEBE), each of these options have their own shortcomings and none are a true “set it and forget it” method. Our geek oriented solution to Firefox profile backups is to use a batch script which can be run at any time. Regardless of whether or not you have Firefox open, this script will capture your current Firefox profile and store it in a zip file for easy recovery.

The Script

Overall, the script doesn’t do anything magical. It simply goes to the respective user’s Firefix profile folder and copies all the unlocked files to a temporary directory and finally creates a zip archive of the files. You will need to have the 7-Zip command line tool copied to a folder set in your Windows PATH variable in order for the zip process to complete.

Scheduling the Backup

Once you have the script in place, you simply need to schedule it via the Windows Task Scheduler. You can use the graphical interface or via the command line tool, SchTasks, to easily set it to run daily for the current user:

Important Note: The script makes reference to profile specific locations (%USERPROFILE% and %APPDATA%), so it is important the scheduled task runs as the respective user account you want to backup the Firefox profile for.

Limitations

This script will pick up any unlocked file as part of the backup. When Firefox is open, a file named “parent.LOCK” is created and this file is not included in the backup. It is a zero byte, so bit-wise the profile backup can complete without including this file.

Certain add-ons may also lock files while Firefox is open, but our testing has not found any instances where this is the case.

Download the 7-Zip Command Line Tool

Manually Backup a Firefox Profile

FEBE Add-on for Firefox