feat(migration): Add standalone BitFun data migration - #2879
Merged
Conversation
Establish the persistence inventory and source format used by the BitFun-to-OpenBitFun importer before implementing data transfers. - Map legacy settings, credentials, extensions, sessions, memories, and remote connection data to their persistence owners. - Document migration boundaries, implementation stages, and the distinction between static inventory and release validation. - Add a supported-source matrix and versioned fixtures covering durable records alongside runtime files that must be excluded. Provide a common reference for import adapters and recovery checks without treating the inventory as proof of real-device migration.
Introduce a shared offline importer so product hosts can discover legacy data and coordinate migration without implementing storage operations in their UI or command handlers. - Define migration selections, plans, findings, progress, and reports. - Discover supported sources and resolve isolated source and target roots while keeping legacy data read-only. - Add locking, staging, journal recovery, cancellation, and rollback for domain imports that have not completed validation. - Snapshot committed SQLite data, including WAL contents, through SQLite backup operations instead of copying live database files. - Register the service crate and dependency boundaries, and cover recovery, source preservation, and lock contention with tests. Keep data conversion in owner adapters while the engine coordinates storage operations and records recoverable migration state.
Connect the offline engine to the persistence owners of legacy user content so each domain can convert and validate its own records. - Import application settings and credentials with target conflict handling and product-specific configuration conversion. - Add import adapters for user skills, agents, and MiniApps. - Migrate workspace and session records together with coordination data, and repair the historical coordination schema v2 layout. - Expose offline persistence helpers for session and workspace data without starting the normal Agent Runtime. - Add memory, SSH, and Remote Connect import adapters with explicit handling of credentials and existing target records. - Extend fixtures and focused contracts to exercise owner imports, persisted metadata, and recovery after interrupted migration. Keep persistence behavior with its existing owners and limit the migration delivery profile to the dependencies it actually needs.
Expose migration through a standalone application that can operate while Desktop is shut down and return users to the product afterward. - Add the migration-only delivery profile, independent WebView identity, typed commands, and scan, confirm, and execute screens. - Persist handoff requests with nonce, expiry, product, channel, and capability checks; accept only a run ID on the command line. - Resolve sibling executables from product binary names and inspect active writers before starting offline migration. - Add first-launch onboarding, settings status and actions, startup notifications, and an Installer entry point. - Persist onboarding decisions and report references across restarts. - Build and package the Migrator sidecar with Desktop and Installer, including branded binary projections and packaging checks. - Register local migration operations in the product operation registry and provide localized user-facing controls. Keep migration execution in the standalone host while Desktop and Installer prepare requests and present migration state.
Migration testing exposed lost configuration fields, stale assistant workspace context, and launch failures that prevented normal imports. Preserve core user data and correct the startup and reporting paths. - Preserve agent profiles, default models, and unknown extension content instead of discarding data through narrow conversions. - Import assistant workspaces and rehome session workspace metadata while leaving historical tool calls and turn content unchanged. - Omit rebuildable prompt caches and non-core data from migration. - Keep orphaned session relationships from blocking an entire import and accept empty legacy SSH workspace records. - Support long Windows storage paths and retain sanitized failure details without exposing user content or credentials. - Add diagnostic export and recovery coverage, and distinguish staged counts from verified results in the migration report. - Gate onboarding actions until bootstrap is ready and correct completion behavior for development and release handoffs. - Allow the existing opt-in development retry for Windows Job breakaway failures and report launch errors without blocking Desktop. - Remove the Authenticode prerequisite across launch and restart paths while retaining fixed-name sibling and file-layout checks. - Restrict import helper visibility and keep memory test helpers out of production builds. Align the migration inventory and implementation notes with the reduced scope and the behavior established during migration testing.
wsp1911
force-pushed
the
legacy-migration-main-integration
branch
4 times, most recently
from
September 7, 2026 17:38
15e05af to
5f69981
Compare
Successful migrations showed warnings for expected exclusions, while View Report only refreshed an already displayed summary. Development startup also required a manually built Migrator and an environment flag. - Open report details with per-domain results and grouped explanations. - Treat excluded session paths and orphaned parent relationships as informational, and count warnings by their actual severity. - Exclude normal built-in MiniApp storage imports from conflict counts while preserving existing target-conflict handling. - Simplify migration instructions in English and both Chinese locales. - Automatically retry denied Windows Job breakaway in Debug builds without an environment flag; retain Release launch behavior. - Incrementally build Data Migrator before Desktop dev and preview startup, and stop with an error if preparation fails. Validation: focused migration tests, Web and locale checks, Migrator script checks, and dev script syntax checks passed. Application startup and UI interaction were not exercised.
wsp1911
force-pushed
the
legacy-migration-main-integration
branch
from
September 7, 2026 18:07
5f69981 to
d6fa7a7
Compare
Windows CI timed out waiting for descendant PIDs in both process-tree cleanup tests, although the original fixtures passed locally. - Replace PowerShell and ping fixtures with explicit parent and leaf roles in the existing test executable. - Publish readiness from the running leaf itself and keep subprocesses hidden through the shared process command helper. - Preserve parent-exit coverage, cleanup assertions, and timeout bounds without changing production process-tree behavior. This removes external shell startup and launch dependencies from the fixture without claiming a confirmed cause for the original CI timeout. Validation: process-tree tests passed ten consecutive Windows runs; all five process-runtime integration contracts also passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a standalone Data Migrator for importing legacy BitFun data into OpenBitFun. Desktop first-launch onboarding, migration settings, and the Installer can launch it; the migrator scans the selected data, confirms the scope, imports it offline, and reports the result before returning to Desktop.
Type and Areas
Type: Feature, bug fix, UI/UX, docs, and tests.
Areas: Rust contracts and persistence services, core migration adapters, Desktop/Tauri, standalone Data Migrator, Web UI settings, Installer, product definitions, and build scripts.
Motivation / Impact
The product rename uses new data locations and some renamed persisted fields. Users need to bring their existing BitFun settings and conversation history forward without manually reconstructing their environment.
Migration keeps the legacy source unchanged and reports target conflicts. Built-in MiniApp code comes from the new installation while its saved user data can be imported. Orphaned parent-session references and expected runtime-file exclusions do not block successful imports. Assistant sessions receive current workspace paths without rewriting historical tool calls.
Development startup prepares the Migrator automatically and handles Windows Job restrictions without requiring a manually configured environment variable.
Verification
Passed during implementation, before the final rebase:
cargo test -p openbitfun-core --no-default-features --features legacy-migration --lib legacy_migration::— 34 tests passed.cargo test -p openbitfun-legacy-migration— 20 tests passed.cargo test -p openbitfun-data-migrator— 6 tests passed.cargo check --manifest-path OpenBitFun-Installer/src-tauri/Cargo.toml— passed.pnpm run check:webandpnpm run i18n:audit— passed.node --test scripts/data-migrator-tauri-build.test.mjs— 5 tests passed.node --check scripts/dev.cjspassed.After rebasing onto upstream main:
node scripts/generate-interactive-capabilities.mjs --check --quiet— passed.git diff 1185658cc..HEAD --check— passed.Manual evidence and limitations:
0xc0000139 / STATUS_ENTRYPOINT_NOT_FOUND); these are not recorded as passing tests.Reviewer Notes
Checklist