So you've embedded Django in your product lines and you want to provide a save/restore function. You, of course, are using South migrations, and since you're agile, you often wind up with schema modifications as requirements change. Since you're managing a lot of products, you want whatever solution you use to be at least somewhat generic. What you want to do:
- specify what apps/tables/fields to include/exclude from the save file
- use a stable format (dumpdata xml is fine for now)
- include random data-files (can be extremely large, so needs hard-linking and streaming upload/download)
- use a standard format (e.g. .tar.gz)
- run syncdb to get non-south-mediated apps updated
- do selective copying of non-save-file data into the new database
- restore all south-mediated migrations to the same point as the incoming file
- validate incoming files on a whole-import/app/table/field basis
- restore the validated incoming records
- fixate the incoming data-files
- run the remaining south migrations
- move the database into place
- run a post-update script to set up all of the various permissions, content-types, and other messy stuff, as well as getting your server restarted with the new database
Any existing solutions that do this kind of thing? I'm really not satisfied with my "solution", as it seems there is way too much surface area for breakage in-the-field (e.g. your validation changes over time, but it needs to be able to validate any old data-file, your syncdb-based tables are going to be in random states, random security issues, etc). Basically, while it could work in theory, I expect it to be a PITA in the real world.
I really don't want to download the whole database file/dump, as then we'd need a separate database for any material that shouldn't be in the download files (e.g. user accounts, as you don't want to share your (hashed) password when you share your configuration). Eventually I'll want it on some multi-user projects, so in those cases I'll also need to be able to specify subsets of tables (i.e. just that user's configuration), but for now I'm working on single-user projects.
Pingbacks are closed.