Tuesday, 28 January 2020

backup - Backing up Google Chrome


Having recently switched to Google Chrome, I was wondering what files and directories I should be including in my backups to make sure that bookmarks and history are included. Along the same lines, is there a process to restore these settings on a new install?


This is on Windows Vista.



Answer



On Windows, Google Chrome and Chromium store their histories, bookmarks, settings, and such in the User Data directory under the program’s folder in the user’s local-data directory (ie not carried over when you log-on to other computers on the same network). Google Chrome uses the folder Google\Chrome while Chromium uses Chromium (big surprised huh?)


There are many ways to access the user’s Chrom(e|ium) folder, dynamically or statically, but the easiest, most reliable are:


For Google Chrome:
"%localappdata%\Google\Chrome\User Data"

For Chromium:
"%localappdata%\Chromium\User Data"

(You can use shell:local appdata in Explorer, but that won’t work in the command-prompt or batch scripts, so you’ll need to use the %localappdata% environment variable which should be set anyway.)


NB: the folders in question are the ones created and used by default; you could easily have Chrome/Chromium use one from elsewhere with the --user-data-dir switch.


(For brevity, henceforth, “Chrome” refers to both Google Chrome and Chromium unless otherwise noted.)




Backing up the settings and such is as simple as copying the folder and its contents since, however you don’t need to keep it all when you make a backup—especially since Chrome is currently plagued by a cancerous user-data folder.

(Make sure to quit all instances and copies of the browser so that no Chrome.exe processes remain before copying/restoring, otherwise some files will be locked, and other temporary files will remain undeleted.)


Some files and folders may or may not exist depending on the Chrome version and whether extensions, plugins, etc. have been installed.




The following files and folders are either temporary (eg cache), or regenerated/updated, and thus can be deleted or omitted from the backup.

  • UserData\​Safe Browsing Bloom    (the anti-phishing file is regularly updated anyway)

  • UserData\​Safe Browsing Bloom Filter 2    (basically the same thing, and even smaller)

  • UserData\Default\​ Cache\    (and all of its contents—whether normal, or for media—is emptied out anyway when you clear the cache)

  • UserData\Default\​Last Session    (the session and tabs files are only useful if the browser has crashed, otherwise they just get recreated the next time you run or exit Chrome)

  • UserData\Default\​Current Session    (session files hold things like the state of forms such as data typed into text fields)

  • UserData\Default\​Last Tabs    (tabs files indicate what tabs were open to what URLs)

  • UserData\Default\​Current Tabs    (Current is the status of Chrome during the most recent time it was open, while Last is the state from before it was opened—restoring a crashed session means Chrome will overwrite the Current files with the Last files)

  • UserData\Default\​Thumbnails    (this keeps graphical thumbnails of all of the the ‘most visited’ sites for display in the MRU list—whether or not they actually currently appear on the list—as well as favorite icons; known to get quite big in recent versions with even modest browsing)

  • UserData\Default\​Bookmarks.bak    (just a backup of the bookmarks file in case the regular one gets corrupt if Chrome crashes)

  • UserData\Default\​*-journal    (you will only have these if Chrome is running—in which case exit Chrome—or else if Chrome crashed)

  • UserData\Default\​JumpListIcons\    (contains ICO-format files of the favorite-icons of the open tabs)

  • UserData\Default\​Transport Security    (related to secure connections; transient)




The following files and folders are the ones you will want to keep.

  • UserData\​Local State    (this is basically just the status of the browser, eg window position, crashed or not, sessions, etc.—you don’t actually need to keep this since it is regenerated anyway, but if you want to keep the window in a specific position or something, then copy it)

  • UserData\​Custom Dictionary.txt    (whenever you “Add to dictionary” in the spell-checker)

  • UserData\Default\​*History*    (browsing history, past, present, and future—includes downloads)

  • UserData\Default\​ Cookies    (cookies, normal and extension ones if you have any installed)

  • UserData\Default\​Bookmarks    (bookmarks, of course)

  • UserData\Default\​Databases\    (per-site offline data—as yet contains very little if any useful data)

  • UserData\Default\​Extensions\    (extensions, ie installed .CRX files—or unpacked extensions)

  • UserData\Default\​Favicons    (this used to hold the favorite icons—the icons associated with pages, but these have since been moved to Thumbnails; you may have this file left over from older versions of Chrome)

  • UserData\Default\​Local Storage\    (this is where sites—and extensions—store more advanced offline data and settings as opposed to using cookies; ie a long-term storage of site-related data like a “My Documents” for the web)

  • UserData\Default\​Login Data    (this contains auto-login data—passwords are encoded, but usernames/email addresses/etc. are clear-text)

  • UserData\Default\​Plugin Data\    (data associated with various plugins, by site, often contains—only—a folder for Google Gears, containing data for sites that use Gears such as MySpace)

  • UserData\Default\​Preferences    (preferences, including pretty much all of the settings in the Wrench->Options dialog, but also installed extensions, plugins, per-page zoom and translation settings, content and privacy black/white lists, tips, and whether or not Chrome crashed last time)

  • UserData\Default\​Top Sites    (stats and info for determining MRU list on New Tab page—you'll probably notice some discrepancies, but if you like having your most visited pages available quickly, you'll want this)

  • UserData\Default\​User Scripts\    (like extensions, but less so, ie .JS files)

  • UserData\Default\​User StyleSheets\    (often only contains a blank Custom.css file, but can contain stylesheets for customizing pages and sites)

  • UserData\Default\​Visited Links    (determines purple links)

  • UserData\Default\​Web Data    (this has all of your custom searches, auto-login data, auto-complete data, credit-card/address/etc. auto-fill data—​some of this information like login data has been offloaded to other files, but may also still be present here​)




(Almost) all of the binary files that Chrome uses are SQLite3 database files—text files and Visited Links being notable exceptions. As such, before archiving a backup copy, you may want to consider using an SQLite3 tool to vacuum out the files to cut out any wasted space, and do an integrity check on them. (Note, older versions of Chrome used FTS2, which would break when vacuum’d.)

Since some files tend to get quite big after a while, you may also want to compress them if you are going to store them for a while (7-Zip is free and can compress them quite a bit at a decent speed).



Finally, if you use a browser backup tool (that supports Chrome/Chromium), make sure to use the latest version possible because since Chrome and Chromium are under constant development, the user-data folder and its contents are in flux and subject to change—some stop being used, other new ones get added, etc.—and an out-of-date backup utility can result in missing files while at the same time leaving you thinking that you are backed up.

No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...