opencode icon indicating copy to clipboard operation
opencode copied to clipboard

migration: make V1 to V2 an explicit one-way cutover

Open joe-ieta opened this issue 1 month ago • 1 comments

Description

V1 → V2 should be an explicit, one-way switch for the shared OpenCode environment, not a silent per-project upgrade.

This consolidates #50130 and #54272 as an alternative policy:

  • #50130 reports that V1 sessions created after the initial import stay invisible in V2.
  • #54272 proposes a watermark to repeatedly import newer V1 sessions.

Both concern continued V1 use after cutover. A history watermark alone cannot make shared configuration, project-local plugins, and independently evolving histories safe to switch between. Prefer an explicit cutover over maintaining recurring cross-version synchronization.

Proposed behavior:

  1. Require acknowledgment before importing V1 history: back up the environment, stop V1, and use V2 from then on.
  2. State that this applies to every project sharing the computer's OpenCode data/configuration. Later V1 writes are not imported; V2 changes are not synchronized back.
  3. Show the notice once to already-migrated profiles too. Keep interrupted initial imports resumable, without recurring watermark imports or overwriting established V2 history. Existing omissions need separate recovery.
  4. Explain that uninstalling/reinstalling V2 does not restore V1. Rollback requires a complete pre-upgrade backup and separately preserving V2-only work.

This is a supported-use contract; V2 cannot prevent an old V1 binary from starting. The existing issue and PR remain linked for maintainer review, rather than being closed automatically.

Plugins

Shared global/project-local configuration and plugin locations are part of the compatibility concern.

OpenCode version

V1 1.19.5 and V2 2.2.0

Steps to reproduce

  1. Complete the V1 → V2 import using a shared data/configuration directory.
  2. Return to V1 and create another session.
  3. Open the project in V2: the session is missing, while migration reports completed.

Observed: migration completed October 19; a session created October 20 remained only in the V1 tables (815 messages) and needed separate, backed-up recovery.

Screenshot

No response

Operating System

Windows 11

Terminal

Desktop; the same explicit cutover should be available to TUI and headless clients.

joe-ieta avatar Oct 29 '26 02:10 joe-ieta

Thanks for the detailed write-up, @joe-ieta!

To restate the request: V1 → V2 would become an explicit, one-way cutover. Before importing V1 history, OpenCode would ask you to confirm that you have backed up and will stop using V1. The notice would make clear that it applies to every project sharing the same OpenCode data and config, and that later V1 sessions won't be imported or V2 changes synced back. It would be shown once to profiles that already migrated, and it would explain that reinstalling V2 does not restore V1. This would replace recurring watermark imports.

I've marked this as a feature request so maintainers can weigh it against the current approach. I can't promise anything about whether or when it will happen.

Related issues:

  • #50130: the underlying bug (V1 sessions created after the migration completes are never imported). It is open and has been reproduced.
  • #54272: the PR proposing a watermark that keeps importing newer V1 sessions, the alternative this issue argues against.
  • #42671: an earlier, closed report of the V1 → V2 migration losing or hiding history in other ways.

opencodejr[bot] avatar Oct 29 '26 02:10 opencodejr[bot]