Idea #15849
closedMigrate collection & project properties to new vocabulary format
Description
Customer databases which use literal text labels for property/value pairs need to be converted to the new ID format in the database.
Input to this will be a new format vocabulary file which matches the original vocabulary file used in creating the database.
This will be an example script which accesses the database through the API.
Updated by Lucas Di Pentima about 5 years ago
- Assigned To set to Lucas Di Pentima
Updated by Lucas Di Pentima about 5 years ago
- Status changed from New to In Progress
Updated by Lucas Di Pentima about 5 years ago
Updates at 8e1ca7677 - branch 15849-vocab-migration-example
Adds vocabulary migration example script to the documentation's admin section with an explanation on how to use it.
Updated by Peter Amstutz about 5 years ago
You can use required=True
instead of default=None and then checking the value later.
opts.add_argument('--vocabulary-file', type=str, metavar='PATH', default=None,
list_all
should use a stable ordering, like "created_at"
I know I said to put the script into the docs, but it occurred to me that you could put it in tools/vocabulary_migrate/vocabulary_migrate.py
and have a symlink from docs/_include/_vocabulary_migrate_py.liquid
to ../../tools/vocabulary_migrate/vocabulary_migrate.py
The {% comment %} makes it not directly executable as Python. A regular '#' comment is fine.
The migration script tag / values label matching is case sensitive. I'm not quite sure what to do about it, thought I'd mention it.
Updated by Lucas Di Pentima about 5 years ago
Updates at c6b259220
Addressed above comments. Added a note on the documentation about case sensitive matching.
Updated by Peter Amstutz about 5 years ago
Lucas Di Pentima wrote:
Updates at c6b259220
Addressed above comments. Added a note on the documentation about case sensitive matching.
One more comment, if you do --dry-run and there is nothing to do, it exits silently, whereas an actual run will say "Done, total object migrated: 0"
- should be "objects"
- for dry-run it should say something like "nothing to do"
otherwise LGTM.
Updated by Lucas Di Pentima about 5 years ago
- Status changed from In Progress to Resolved
Applied in changeset arvados|c884807d0bf8c32bb220ba382c97a455ade4bd0a.