Backing up Google Chrome

34

12

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.

dlux

Posted 2009-07-27T20:12:46.357

Reputation: 4 183

Answers

29

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.

Synetech

Posted 2009-07-27T20:12:46.357

Reputation: 63 242

1You can also use shell:local appdata. ;) – Synetech – 2010-02-26T17:20:54.260

This 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 the user data directory and it works... – jj_ – 2017-05-16T03:14:02.560

The fastest way to get there is to type into the Start Menu: %localappdata%\Google – jasonh – 2009-12-11T19:28:35.813

1I 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 by Local State alone. – yurkennis – 2014-04-17T14:30:14.270

And 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 as Default. The first (should) be Profile1, then Profile2, and so on. (In my case, the second profile was Profile8 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.413

1"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

10

Chrome saves it's settings in the active windows user-profile. This can be located here:

Windows-XP: C:\Documents and Settings**[user name**]\Local Settings\Application Data\Google\Chrome\User Data

Windows Vista: C:\Users**[User name]**\AppData\Local\Google\Chrome\User Data

Backup that whole directory and restore it when you install in your new machine.

pavsaund

Posted 2009-07-27T20:12:46.357

Reputation: 2 660

Damn, 46 seconds too late! +1 – Vinko Vrsalovic – 2009-07-27T20:42:36.377

hehe, i hate it when that happens! glad to be on the faster side for once. thanks for the + :) – pavsaund – 2009-07-27T20:49:48.623

A handy shortcut for the local user data folder is: %localappdata% – jasonh – 2009-12-11T19:29:10.417

5

If you aren't paranoid and have a Gmail account, then you can configure Chrome to automagically synchronize pretty much everything for you:

configure sync:

I use this method to synchronize my bookmarks, extensions and themes across 3 computers and used it recently to restore everything after a re-install of XP.

To access this screen:

  • click the wrench icon in the upper-right corner
  • click Options
  • click Personal Stuff
  • Sync -> Customize

glenneroo

Posted 2009-07-27T20:12:46.357

Reputation: 1 800

A while ago, only bookmarks were sync-able. Do you know what version the rest were introduced in? – Synetech – 2011-03-16T03:41:19.620

A quick Google says around June 2010 they merged "Extension sync" plugin into Chrome (http://downloadsquad.switched.com/2010/06/09/extension-sync-support-lands-in-google-chrome-source-code/) so I guess Version 9 or 10?

– glenneroo – 2011-03-23T05:43:25.697

1

For people using Ubuntu, like me, the answer is to look in ~/.cache/google-chrome/Cache and ~/.cache/google-chrome/Media\ Cache.

isomorphismes

Posted 2009-07-27T20:12:46.357

Reputation: 1 534

0

  1. Locate your User Data Directory by navigating to chrome://version.
  2. To backup profile folder, look for Profile Path.
  3. To backup the user data directory, it is the parent of the profile directory.

For details, refer to above link.

kenorb

Posted 2009-07-27T20:12:46.357

Reputation: 16 795

0

Looking through the Lifehacker archives, I found this little gem.

FavBackup is a simple solution for you to backup and restore web browser settings and other data on Windows 7/Vista/XP/2000 systems. No installation required.

digitxp

Posted 2009-07-27T20:12:46.357

Reputation: 13 502