Greg Thompson | 47bdc67 | 2020-01-06 14:25:31 | [diff] [blame] | 1 | # User Data Storage |
| 2 | |
| 3 | This document explains the Chromium policies for files in the `User Data` |
| 4 | directory. |
| 5 | |
| 6 | [TOC] |
| 7 | |
| 8 | ## Backward Compatibility |
| 9 | |
| 10 | Due to the nature of frequent updates, Chromium must always support loading data |
| 11 | from files written by previous versions. A good rule of thumb is to leave |
| 12 | migration code in place for *at least* one year (approximately 9 milestones with |
| 13 | the current 6-week release cadence). It is not uncommon for clients to update |
| 14 | from very old versions, so use good judgement for deciding when to remove |
| 15 | migration code -- if the complexity is low, keep it indefinitely. |
| 16 | |
| 17 | ## Version Downgrade Processing |
| 18 | |
| 19 | In cases where Chromium is run against a `User Data` directory written by a |
| 20 | newer version, the browser may run to the extent possible with the following |
| 21 | behaviors: |
| 22 | |
| 23 | * Versioned files that are apparently readable by the old version may be used |
| 24 | as-is and modified as needed. For example, a SQLite file containing a table |
| 25 | with a compatible version number no higher than that supported by the old |
| 26 | version. |
| 27 | * Versioned files that cannot be read by the old version and contain user |
| 28 | configuration or user generated data are left on-disk unmodified. This |
| 29 | allows the data to be used again once the browser is updated. Furthermore, |
| 30 | the user should be notified via the [profile error |
| 31 | dialog](../chrome/browser/ui/profile_error_dialog.h) that their experience |
| 32 | may be degraded. For example, such a browsing session may not accumulate new |
| 33 | history database entries. |
| 34 | * Versioned files that cannot be read by the old version and contain computed |
| 35 | or cached data may be either left on-disk unmodified or deleted and |
| 36 | replaced. |
| 37 | |
| 38 | ## Post-branch Compatibility |
| 39 | |
| 40 | Breaking changes in data storage are forbidden once a branch has been created |
| 41 | for a release. This guarantees that data written by a later build on a release |
| 42 | branch can be read by previous versions on that same release branch. |
| 43 | |
| 44 | ## See also |
| 45 | |
| 46 | * [User Data Directory](user_data_dir.md) |