Ecotrust / ak-logbook

Alaska Logbook
MIT License
1 stars 1 forks source link

Dump/Restore user survey data [2 weeks] #66

Open rhodges opened 10 years ago

rhodges commented 10 years ago

Pull all users data out Upload data onto new, clean Formhub server

Questions: How to pull out data for multiple users/accounts? Recreate accounts on import/restore? Passwords?

rhodges commented 10 years ago

To copy from one FormHub instance to another:

  1. systematically export a user's csvs for one survey
  2. Read those in to a data structure (DB, JSON, object, whatever)
  3. Manipulate data into XML* submission format
  4. Submit to new FormHub instance

To rename a field: In step 3 above, apply necessary logic to map old field value into new field

To add a field: Must define a default value or derive one from existing answers for the new field

To delete a field: Simply leave it out of step 3

To convert data: Write custom conversion logic into step 3

* This is how Enketo does it. Maybe submissions can be uploaded in another format, one we're more comfortable with.