Upgrade and legacy migration workflow
The upgrade workflow helps an installation move from older Insights behavior to current resource models without hiding work that needs review. It blocks unsafe v2 upgrades, records changes that need a person, and presents those findings in a guided wizard for the users and admins who must act on them. See Application runtime and integration for the wider app lifecycle and Deployment, setup, and migrations for the full patch sequence.
Upgrade boundary
An upgrade has two paths. Legacy v2 data can stop the site upgrade when recent dashboards were not migrated. A site already moving from an older v3 release continues through automatic data changes, then receives a review list for effects that cannot be carried over safely.
Legacy v2 gate
The v2 gate protects data that the current release no longer knows how to migrate. It checks for v2 queries used in the last 30 days, finds the v2 dashboards that contain them, and compares them with current dashboards marked as migrated. An unmigrated, recently used dashboard stops the upgrade before v2 records are removed. Queries that were never inside a dashboard do not block the upgrade because the old migrator did not carry them over. insights/…/check_legacy_v2_data_before_upgrade.py• L7-18, insights/…/check_legacy_v2_data_before_upgrade.py• L57-112
The supported route is to remain on the earlier release and migrate the dashboards first. A site setting can bypass the gate when the owner accepts that remaining v2 data will not be carried over. This is an explicit data-loss choice, not a second migration path. insights/…/check_legacy_v2_data_before_upgrade.py• L24-47
References: insights/…/check_legacy_v2_data_before_upgrade.py• L13-18 insights/…/check_legacy_v2_data_before_upgrade.py• L57-112
Current model transition
The current-model transition runs ordered patches that reshape old records into the workbook, query, chart, dashboard, permission, data-store, and alert models used by the current app. These patches perform the changes that can be made with confidence. The later reporting patch then describes the cases where a person must restore intent or review a changed result. insights/patches.txt• L1-5, insights/patches.txt• L7-54
The reporting phase runs only when the installed release is older than Insights v3.50. It does not change customer data. Instead, it creates durable upgrade findings after sharing and alert ownership changes have settled, so each finding reflects the permissions and ownership that the current model will use. insights/…/report_upgrade_items.py• L1-5, insights/…/report_upgrade_items.py• L38-48
The overall path is shown below.
flowchart TD
A[Site update starts] --> B{Recent unmigrated v2 dashboards?}
B -->|Yes| C[Stop update and migrate v2 dashboards]
B -->|No| D[Run ordered model migrations]
D --> E[Report changes that need review]
E --> F[Load findings for each reader]
F --> G[Review, fix, dismiss, or reopen]
G --> H[Current Insights resource models]
References: insights/patches.txt• L1-54 insights/…/report_upgrade_items.py• L38-48
Upgrade findings
An upgrade finding is a durable record of a change that an automatic patch could not resolve without a user decision. It connects a plain-language message to the affected resource, the user concerned, and structured data that the client uses to explain the finding and offer the right next step.
Finding records
The Insights Upgrade Item is the shared record for these findings. Its status is Open, Done, or Dismissed; its optional action is limited to a safe workbook deletion or a settings view. A patch uses a stable code and reference to avoid creating a duplicate when it runs again, and a dismissed finding stays dismissed. insights/upgrade.py• L11-48, insights/…/insights_upgrade_item.json• L19-85
The finding data is split between two audiences. The message is a stored fallback, while structured values name the workbook, document, people, reason, or setting that the browser must show. The API resolves user names and adds the current workbook route, desk form link, and permission to apply an offered fix. insights/…/upgrade.py• L18-52
References: insights/upgrade.py• L22-48 insights/…/insights_upgrade_item.json• L29-85 insights/…/upgrade.py• L18-52
Finding scope
Findings belong either to a specific user or to the admin audience. A normal reader receives their own findings. An Insights Admin or System Manager receives the site-wide findings and findings for other users, except for personal notes that must stay with their reader. The same scope controls the item count shown in the session and the rows built by the wizard. insights/upgrade.py• L97-120, insights/…/__init__.py• L138-157
The report covers effects that cross the old and current models. Typical groups include site permissions, public chart ownership, workbook access, alert execution, changed number settings, old template copies, and scripts or imports that no longer run under current limits. These are not a general audit: they are findings created for the upgrade that introduced the changed rule. insights/…/report_upgrade_items.py• L38-48, frontend/…/upgrade_steps.ts• L152-233
References: insights/upgrade.py• L102-120 insights/…/__init__.py• L151-157 insights/…/report_upgrade_items.py• L50-237
Guided frontend flow
The frontend turns the server findings into a reader-specific upgrade path. It first explains the release and available features. It then groups findings by the kind of change and gives each item a sentence, a suggested action, and a link to the resource or desk form that can resolve it.
Welcome and feature tour
The wizard opens for users marked as not yet welcomed by the migration. Its feature pages are filtered by what the current user can read or manage, so the tour does not promise access that the user cannot use. The feature tour covers current chart behavior, drill-downs, shipped app dashboards, desk charts, and the workbook-based sharing model. frontend/…/upgrade.ts• L62-77, frontend/…/upgrade_steps.ts• L53-123
The welcome state is separate from finding completion. Closing the dialog keeps the user’s place for the current visit. Finish or Skip marks the release as seen on the server, while a sidebar card remains available when open findings or unfinished pages still need attention. frontend/…/upgrade.ts• L115-150, frontend/…/UpgradeCard.vue• L10-37
References: frontend/…/upgrade_steps.ts• L53-123 frontend/…/upgrade.ts• L115-150 frontend/…/UpgradeCard.vue• L10-37
Finding review
The wizard groups findings into steps such as Access, Public Charts, Workbook Access, Alerts, Numbers, and Template Copies. It combines duplicate views of one change into one row, but keeps all underlying item names so one decision closes the same set the server returned. Findings that only explain a change are marked for reading; findings that can cause a failure or require a choice are marked as needing action. frontend/…/upgrade_steps.ts• L152-233, frontend/…/upgrade_steps.ts• L250-353
Each row explains what changed and what to do next. A row can open an Insights route, open a desk form, open settings, or apply a server-side fix. Links open in a new tab with a marker that prevents the wizard from opening over the page it launched. frontend/…/upgrade_steps.ts• L510-554, frontend/…/UpgradeStepView.vue• L126-155
References: frontend/…/upgrade_steps.ts• L290-353 frontend/…/upgrade_steps.ts• L546-554 frontend/…/UpgradeStepView.vue• L129-155
Progress and completion
The browser stores the current step, visited steps, and finish state per user. The server remains the source for finding status, so a later session can resume with the first open item even after the local wizard state is complete. Done means a fix was applied; Dismissed means the reader marked the finding as handled without using an automatic fix. frontend/…/upgrade.ts• L30-45, frontend/…/upgrade.ts• L79-97, frontend/…/upgrade.ts• L153-199
The sidebar count comes from open findings in the reader’s scope. This lets the main wizard, the sidebar, and the server stay aligned when an admin sees both site findings and user-specific findings. frontend/…/UpgradeCard.vue• L18-37, insights/…/__init__.py• L151-154
References: frontend/…/upgrade.ts• L30-45 frontend/…/upgrade.ts• L79-97 frontend/…/upgrade.ts• L153-199 frontend/…/UpgradeCard.vue• L18-37
Upgrade APIs
The upgrade API is the boundary between persisted findings and the guided client. Read calls return only the findings the current session may work through. Write calls re-check that scope and the current status before changing a finding or applying a fix.
Finding retrieval
get_upgrade_items returns open and closed findings in code order so the wizard can show both unfinished work and what the reader already handled. It removes references to doctypes that no longer exist, parses structured data, resolves names for people, and derives the current route and fix permission. get_shipping_apps supplies app titles and logos for the feature tour. get_template_workbook resolves old template links to a site copy or its current standard workbook. insights/…/upgrade.py• L17-52, insights/…/upgrade.py• L183-208
The session API supplies the flags that shape the wizard: whether the user is a first-time reader, how many open findings they have, whether they are an upgrade admin, and which current features they can show. This keeps client navigation aligned with server permissions instead of making the browser infer them. insights/…/__init__.py• L117-167
References: insights/…/upgrade.py• L17-52 insights/…/upgrade.py• L183-208 insights/…/__init__.py• L117-167
Finding state changes
The client can dismiss a set of open findings, reopen closed findings in its scope, or apply an offered fix. The server filters each request again, so a reader cannot close another reader’s finding and an automatic fix cannot run without permission on the referenced resource. The only current automatic resource fix deletes an unchanged template copy; settings actions open the settings view for the reader to make the change. insights/…/upgrade.py• L139-181
The deletion fix checks the workbook again at execution time. If the copy changed after the report was made, the fix is withdrawn and the workbook is kept. This prevents a later wizard visit from deleting work that was not unchanged when the upgrade inspected it. insights/upgrade.py• L131-183, insights/…/upgrade.py• L168-181
References: insights/…/upgrade.py• L139-181 insights/upgrade.py• L123-183
Current resource outcomes
The guided review exists because several older permissions and ownership rules do not map one-to-one to current resources. The automatic patches preserve what they can, while the findings explain the new boundary and point the reader to the current resource that now controls the behavior.
Permission and ownership changes
Site data now follows desk permissions, so a team no longer grants access to rows by itself. Public charts run with their owner’s access, and alerts need a user who can edit the alert’s workbook. Workbook access is the edit boundary for queries, charts, and dashboards; direct shares on those child resources may become read-only or disappear. insights/…/report_site_data_follows_desk.py• L1-16, insights/…/run_public_charts_as_owner.py• L15-35, insights/…/move_alert_run_as.py• L12-21, insights/…/reshape_member_shares.py• L16-25
The resulting findings do not silently restore old access. They tell the reader to use a desk role or User Permission for site data, share the workbook for edit access, or change the owner and access needed for public content and alerts. frontend/…/upgrade_steps.ts• L568-739, frontend/…/upgrade_steps.ts• L740-869
References: insights/…/report_site_data_follows_desk.py• L1-16 insights/…/run_public_charts_as_owner.py• L90-140 insights/…/move_alert_run_as.py• L23-64 insights/…/reshape_member_shares.py• L63-113
Template and workbook migration
Older template copies are identified when an installed app now ships the standard workbook that replaces them. An untouched copy can be deleted by the wizard. A changed copy cannot be deleted automatically; the reader must move needed work to the current standard workbook and then remove the old copy. insights/…/report_upgrade_items.py• L184-219, frontend/…/upgrade_steps.ts• L959-982
This keeps current app dashboards on the standard-workbook path while preserving user edits as an explicit choice. The get_template_workbook API also gives old template links a current destination when a readable replacement exists. insights/…/upgrade.py• L195-208
References: insights/…/report_upgrade_items.py• L184-219 insights/upgrade.py• L139-183 frontend/…/upgrade_steps.ts• L959-982 insights/…/upgrade.py• L195-208
Script and setting migration
Some old scripts, import jobs, queries, charts, and alerts still run but need an admin to edit them under the current trust and sandbox rules. Other scripts use names that the current sandbox rejects and will fail until the author removes those names. Settings findings call out changed number or fiscal-year behavior and direct the reader to set the value again. insights/…/report_upgrade_items.py• L125-182, insights/…/report_upgrade_items.py• L222-237, frontend/…/upgrade_steps.ts• L984-1107
These findings are operational hand-offs rather than automatic rewrites. The upgrade records the affected resource and author so the right person can change the current query, chart, alert, import job, or setting. insights/upgrade.py• L22-35, insights/…/upgrade.py• L45-51
References: insights/…/report_upgrade_items.py• L125-182 insights/…/report_upgrade_items.py• L222-237 frontend/…/upgrade_steps.ts• L984-1107
Change checklist
When these files or sections are changed, remember to consider these:
- Keep every new finding code aligned across the reporting patch, the wizard group, and
SENTENCES; otherwise the server can create an item that the client cannot explain or place. - Keep
Insights Upgrade Item.action,can_fix, the API fix method, and the client action types aligned when adding an automatic fix. - Preserve patch order: findings that depend on workbook shares, public ownership, alert owners, or current settings must run after the patches that establish those values.
- Keep
get_user_infoupgrade flags aligned with the frontend feature gates and with the server item scope. - If a current permission or resource model changes, update both the automatic migration and the finding report that explains its user-visible effect.
- If v2 migration markers or old dashboard names change, update the v2 block and the comparison that decides whether a dashboard was migrated.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A recently used v2 dashboard has no migrated current dashboard | The site update stops before the old model is removed | Migrate the dashboard on the earlier supported release, or set the explicit bypass only after accepting lost v2 data |
| The reporting patch runs before sharing or alert migration | Findings can describe permissions or owners that the current model later changes | Keep report_upgrade_items after share and alert patches in insights/patches.txt |
| A template copy changed after it was reported as untouched | A delete action could remove user work | Recheck the copy before deletion; withdraw the fix when its contents changed |
| A public chart owner cannot read its source data | Readers see Not Permitted or no useful result | Restore the owner’s current read access or change workbook and chart access as the finding directs |
| A finding references a removed DocType | The item cannot be opened safely | Filter missing reference doctypes from API results and avoid treating the finding as actionable |
| A reader submits a finding that is closed or outside their scope | Another user’s item could be changed or a stale fix could run | Reapply scope and status filters in every write endpoint |
Key files
| File | Why to read it |
|---|---|
| insights/…/check_legacy_v2_data_before_upgrade.py | Defines the safety gate for recent, unmigrated v2 dashboards. |
| insights/patches.txt | Shows the ordering contract between model migration, sharing changes, alert changes, and finding reports. |
| insights/upgrade.py | Defines finding identity, user scope, upgrade visibility, and safe template-copy checks. |
| insights/…/report_upgrade_items.py | Shows which old behaviors become findings instead of silent data changes. |
| insights/…/upgrade.py | Exposes finding retrieval, state changes, safe fixes, and current workbook destinations. |
| insights/…/__init__.py | Supplies the session flags and counts that shape the wizard for each user. |
| frontend/…/upgrade.ts | Coordinates server calls, per-user progress, status, resume, and completion. |
| frontend/…/upgrade_steps.ts | Defines feature pages, finding groups, reader actions, and item sentences. |
| frontend/…/UpgradeWizard.vue | Shows the main guided upgrade experience and its navigation. |
| frontend/…/UpgradeStepView.vue | Shows one change at a time and opens the current resource or fix. |
| insights/…/insights_upgrade_item.json | Defines the persisted finding fields and allowed statuses and actions. |