GNOME Bugzilla – Bug 681679
migration should be profile-bound
Last modified: 2012-09-03 18:39:14 UTC
Right now the migration tool will only run on the main profile, but on other profiles. This is broken, as changes in any of the profile data format that might need migration will never be applied for them. The reason why I've found out about this is simple: I am making a few changes to the history database that require the migration tool to run. These happen OK for the main profile, business as usual. However, when opening ephy with an pre-migration profile shows that the database for that profile has not been migrated -- ephy has no way to know if that profile needs to be migrated at all.
I have no idea if this can be fixed at all without breaking all existing profiles already. As there is no .migrated file in existing profiles it's not possible to know which steps of the migration need to be executed for each profile. Since this has not been a problem until now, maybe it would be OK to assume that no .migrated means start with the current step (meaning: the one I am adding now)?
I am working on this.
Created attachment 222284 [details] [review] e-profile-migrator: clean single step
Created attachment 222285 [details] [review] e-profile-migrator: make profile migration a step
Created attachment 222286 [details] [review] e-profile-migrator: update migrate_cookies
Created attachment 222287 [details] [review] e-profile-migrator: add dry_run to parse_and_decrypt
Created attachment 222288 [details] [review] e-profile-migrator: update migrate_passwords
Created attachment 222289 [details] [review] e-profile-migrator: update migrate_passwords2
Created attachment 222290 [details] [review] profile migrator
Patches likely do not build because of minor syntax issues. I am attaching early to comment on the approach. I am basically adding (src, dest, dry_run, data) to every migrator function. This should allow to run arbitrary steps in arbitrary paths. Even only as dry-run tests with extra debugging.
Comment on attachment 222284 [details] [review] e-profile-migrator: clean single step Why is this needed/a good idea? Guys, let's spend 30 seconds writing ChangeLogs...
Comment on attachment 222285 [details] [review] e-profile-migrator: make profile migration a step Unless I'm mistaken this is wrong (that's why it's not a migration step). If you do this at the end you'll first try to do the previous steps while having as profile dir the new XDG target, so they will all fail. Did you test this?
Diego, what's the status of this? We break some profiles already in master (given that we merged the in-tab-overview branch). We should have at least this solved for 3.9.91 ...
Created attachment 223329 [details] [review] ephy-file-helpers: add ephy_dot_dir_is_default() This method will let us know when the current dot directory is the default one and not a user-specified one nor a web application one.
Created attachment 223330 [details] [review] ephy-profile-migrator: allow running migration in non-default profile directories THis is necessary since we add new columns to the history database in step 8 of migration. However, non-default profile directories don't have a .migrated file right now but, since up to step 7 it was possible to use these profiles without migration, it is safe to assume that a non-default profile without a .migrated file can be migrated starting from step 8.
Created attachment 223331 [details] [review] ephy-profile-utils: add a profile_dir parameter to ephy_profile_utils_do_migration() This is passed further on to the migrator process. Right now this is unused.
Created attachment 223332 [details] [review] ephy-main: run the migration for any instance that is not a temporary private one
Review of attachment 223329 [details] [review]: Yep.
Review of attachment 223330 [details] [review]: Makes sense to me. You have a typo in the commit message s/THis/This/
Review of attachment 223331 [details] [review]: OK.
Review of attachment 223332 [details] [review]: Alright. Hopefully we won't destroy everything.... ;)
Attachment 223329 [details] pushed as 55ffe5b - ephy-file-helpers: add ephy_dot_dir_is_default() Attachment 223330 [details] pushed as 1afb017 - ephy-profile-migrator: allow running migration in non-default profile directories Attachment 223331 [details] pushed as 95eb18e - ephy-profile-utils: add a profile_dir parameter to ephy_profile_utils_do_migration() Attachment 223332 [details] pushed as 4757133 - ephy-main: run the migration for any instance that is not a temporary private one