fsdb_migrate_metadata
FSDB Metadata Migration CLILink
One‑time migration of existing scan databases from the legacy flat
Metadata.object biological metadata to the new MIAPPE-aligned tree
(investigation / study / biologicalMaterial).
This CLI reads every scan's metadata/metadata.json, converts the old
object block (v2 Metadata.object or v3 top‑level object) into the
canonical MIAPPE tree and rewrites the file. It is idempotent: scans already
migrated (no legacy object block) are left untouched.
See docs/developers/miappe_metadata.md for the mapping and design.
Usage ExamplesLink
fsdb_migrate_metadata /romi_db
# Migrate without keeping a '.bak' copy of each changed file:
fsdb_migrate_metadata /romi_db --no-backup
build_miappe_tree
Link
build_miappe_tree(obj)
Convert a legacy object metadata dict into the MIAPPE-aligned tree.
Source code in plantdb/commons/cli/fsdb_migrate_metadata.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
main
Link
main(db_path, no_backup, log_level)
Migrate all scans of a database to the MIAPPE-aligned biological metadata.
Source code in plantdb/commons/cli/fsdb_migrate_metadata.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
migrate_metadata
Link
migrate_metadata(metadata)
Return (metadata, migrated) with the legacy object block migrated to the MIAPPE tree.
migrated is False (and metadata is returned unchanged) if no legacy
object block is present, making the migration idempotent.
Source code in plantdb/commons/cli/fsdb_migrate_metadata.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
migrate_scan_metadata
Link
Migrate a single scan's metadata/metadata.json in place.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Path
|
Path to the scan directory. |
required |
|
bool
|
If |
True
|
Returns:
| Type | Description |
|---|---|
bool
|
|
Source code in plantdb/commons/cli/fsdb_migrate_metadata.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |