Migrate SMART patrols¶
The patrol migration moves a SMART conservation area's patrol setup and
history into EarthRanger's patrol model from a backup or export zip, without
SMART Connect: the patrol configuration (patrol-datamodel), a readiness
check (patrol-preflight), then the history (import-patrols).
- Get the site's SMART backup or Conservation Area export zip and run
./smart-able all <zip>in smart-able. This writeswork/export/<ca_id>/datamodel.xml, the configurable models andwork/export/<ca_id>/bundle/. - Push the event data model:
er-smart-sync datamodel --from-file work/export/<ca_id>/datamodel.xml --cm-from-file work/export/<ca_id>/configurable_model_<uuid>.xml --ca-identifier <ID> --bundle work/export/<ca_id>/bundle ...(see Push a data model).--bundlealso creates inactive event types for parent or inactive SMART categories that old observations use, soimport-patrolshas a type for every observation. - Pick the label language in smart-able's Data Model tab and note the
timezone the bundle was written for (
manifest.json); setsmart.use_language_codeandsmart.timezoneinsync.yaml, andbundle.pathto the bundle directory. - Run
er-smart-sync --dry-run patrol-datamodel --config sync.yaml, read the plan, then run it without--dry-run. See patrol-datamodel. The run saves the site's previous universal-fields document next to the checklist; that page's "Undoing a run" section says how to remove everything the command created, should a site need it. - Work through
checklist.md: enable thepatrol_schemaspreview feature if it is off (then re-run step 4 so the universal patrol fields are written), create the teams it lists, and put the subjects in the roster group if the tool could not. - Run
er-smart-sync patrol-preflight --config sync.yamland fix what it reports until it shows no blocking findings. See patrol-preflight. - Run
er-smart-sync import-patrols --config sync.yaml --since <first day> --until <a week later>, check one patrol in ER (legs, members, events on the map, the leader's track), then run without the date window. Re-running is safe: finished patrols are skipped. See import-patrols.
The universal patrol fields need the patrol_schemas preview feature; on a
site where it is off the command still writes the patrol types, choices and
subjects and puts the feature on the checklist (seen on gundi-dev before it
was enabled there).
Quirks of the SMART data that matter here (zone-less times, placeholder
dates, retired staff) are written up in smart-able's quirks.html,
published with every browser it builds.