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\<Media> 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<Old>\ (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\<Extension> 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.
1You can also use
shell:local appdata
. ;) – Synetech – 2010-02-26T17:20:54.260This method no longer works. Google chrome automatically purges the user data directory on first run and tells you that some third party program has tried to modify your settings – taltamir – 2016-05-14T00:43:28.493
@taltamir and then, before second run, you copy again the
default
directory inside theuser data
directory and it works... – jj_ – 2017-05-16T03:14:02.560The fastest way to get there is to type into the Start Menu:
%localappdata%\Google
– jasonh – 2009-12-11T19:28:35.8131I believe
{Last|Current} {Session|Tabs}
are better either positioned into the second list ("you want to keep") or maybe placed into a third group "you decide whether or not worth keeping". Both are definitely self-sufficient to save the last session if the user keeps many tabs open for "read-later" or "useful reference" scenarios; not sure the same effect can be achieved byLocal State
alone. – yurkennis – 2014-04-17T14:30:14.270And it should be noted that
Default
(profile folder) should be populated to as many user profiles the user has set up in his instance of Chrome. – yurkennis – 2014-04-17T14:38:11.080@yurkennis, I’m not sure what you’re saying, but yes, the first profile will be
Default
while subsequent profiles will be in other directories in the same parent asDefault
. The first (should) beProfile1
, thenProfile2
, and so on. (In my case, the second profile wasProfile8
for some reason.) – Synetech – 2014-04-17T21:36:03.423"I’m not sure what you’re saying" -- ask if you have a question :-) – yurkennis – 2014-04-17T22:40:56.077
I believe {Last|Current} {Session|Tabs} … are definitely self-sufficient to save the session if the user keeps many tabs open for "read-later" or "useful reference" scenarios; not sure the same effect can be achieved by Local State alone.
@yurkennis,Local State
only saves info about the browser (position, size, etc.) not open tabs. “Useful references” should be saved with bookmarks. And relying on tab/session files, is a bad idea; they only provide rudimentary session support support… when they work (they always fail when you need them most). – Synetech – 2014-04-18T16:59:19.4131"they always fail when you need them most" -- I backup them before every re-launch of Chrome, which happens one to several times a week. And I don't remember restoring it for several years now--those problems are long gone today. Although I remember the times they happened, and I still have several dozens tabs open most of the time. Anyway, the whole purpose of making backups is to have something to rollback when your current copy is broken or lost. In this sense Session/Tabs are no different than Bookmarks or Saved Passwords. – yurkennis – 2014-04-18T20:01:23.120
@yurkennis, the problem isn’t Chrome crashing or not copying those files, it’s that the won’t work at all. Like I explained in the other question, you cannot rely on them working at all even if they are present. It is much safer to just use a proper session-management extension. – Synetech – 2014-04-20T02:59:23.817
YMMV. I restored them several times during these years, always successfully. – yurkennis – 2014-04-20T07:06:58.873
Like I said, read the explanation I gave. – Synetech – 2014-04-20T14:02:09.100