Version Migrations

Registered by Adam Olsen on 2009-07-06

We need to be able to migrate from one version of Exaile to another. Currently, the most important job for this is the migration from 0.2.14 database and settings to 0.3.x.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
Adam Olsen
Definition:
Approved
Series goal:
Accepted for 0.3.x
Implementation:
Unknown
Milestone target:
milestone icon 0.3.0

Related branches

Sprints

Whiteboard

Basic idea:

should be a separate module in xl, xl/migration perhaps

a file or two for common migration utilities (eg. an easy way of mapping old settings to new), and for providing the means of selecting the appropriate upgrade path.

0.2.14 to 0.3.0+:

this path is the easiest, we can handle it by seeing if firstrun is set, and if it is, check to see if 0.2's settings exist. if they do, prompt the user (if gui is enabled) as to whether they want to import or not. if they do (or there is no gui to prompt with), then import the migration framework for 0.2.14->0.3.0 and run it.

0.3.x to 0.3.y:

we'll need to add versioning data to the settings file and possibly other files (the db already has versioning). these versions should be incremented ONLY on backwards-incompatible changes and will not necessarily align with the global exaile version. when a module detects that it is a newer version than the on-disk version, it should import migration and ask migration to handle the upgrade from oldversion to newversion for that module. if a module detects that the on-disk version is newer than that which it knows how to handle, an error should be displayed to the user explaining this, and once the error is cleared by the user exaile should exit without saving anything, to preserve the user's new data.

possible basic outwards api calls:

per module, as in 0.3.x to 0.3.y:

from xl import migration
migration.run_upgrade("module_name", oldmoduleversion, newmoduleversion)

global, as in 0.2.14 to 0.3.0:

if firstrun:
  from xl import migration
  migration.run_global_upgrade("0.2.14")

random thoughts:

plugins might need upgrade paths too, how can we provide for this?

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.