dsh-workspace-migrate: Package and Migrate DSH Sessions and Projects by Workspace

Introduction

When working on projects in DeepSeek Harness (DSH), session history, workspace registrations, and attachments are all stored in local directories. If you copy only the project folder when switching computers, conversations often remain on the old paths. When the model continues the chat, it references non-existent absolute paths, and tool calls and error messages become misaligned. Full-system backups are too heavy, and it is difficult to take away only a few projects in progress.

jockerbear/dsh-workspace-migrate is a plugin under the DSH category “Memory”, with the interface name “Backup & Migration”. It allows selecting workspaces to export sessions, registrations, files, and attachments, and supports rewriting historical paths upon import on a new machine, enabling old conversations to continue in the new environment. This repository is a localized modification of lij0000-arch/dsh-workspace-migrate v0.5.3, distributed under the MIT License; the maintainer is jockerbear.

What is this?

Plugin positioning: It packages the project registration, conversation event stream, and optional project files and image attachments of the selected DSH workspace into a migration package, restores them on another computer via the Harness public service, and maps the old absolute paths appearing in the conversation to a new root directory during import.

Compared to “copying the whole directory” or migrating only code repositories, it emphasizes three points:

  • Selection by workspace, not a full system dump.
  • Specify a new root directory upon import, with each project landing under <root>/<project-name>, and rewrite old paths within the conversation.
  • Support for incremental updates to existing migration packages, and fast-forward appending for non-forked sessions upon re-import (0.7.0+).

Read/Write Scope (from original docs): Reads ~/.dsh/sessions, ~/.dsh/storages/workspace.json, ~/.dsh/attachments, and the selected project directories; does not read or export ~/.dsh/.credentials.yaml. Regarding networking, it only registers /api/dsh-migrate locally on 127.0.0.1 and does not initiate requests outward.

Installation and Enabling

Plugins are isolated by DSH profile: it installs into whichever profile the current interface is using; a common symptom of installing the wrong one is not seeing the “Backup & Migration” tab in settings. Desktop is generally desktop, and dsh web is web; if unsure, you can run echo $env:DSH_PROFILE.

The installation method provided by the official README is as follows (using a Release pre-built package is recommended; the current version in the documentation is v0.7.0):

# Desktop (Recommended: Release pre-built package)
dsh plugin --profile desktop add "https://github.com/jockerbear/dsh-workspace-migrate/releases/download/v0.7.0/dsh-workspace-migrate-0.7.0.tgz"

# Or install from repository source
dsh plugin --profile desktop add github:jockerbear/dsh-workspace-migrate

The documentation specifically reminds: Do not install using the bare package name dsh-workspace-migrate — the package with the same name on npm corresponds to upstream lij0000-arch’s 0.5.4, not this repository.

If you don’t want to use the command line, you can install it in Settings → Plugins, or ask the agent in the chat to install the repository via plugin_manager. After installation, refresh the page, and you can use it in Settings → Backup & Migration.

The DSH engine requirement declared in package.json is ^0.2.1-rc.2.

Typical Usage: Export and Import

Two-Step Migration

  1. Old Computer: Settings → Backup & Migration → Export (Old Computer) → Check the workspaces to take with you → Start Export. By default, you get a .zip archive and a .sha256 sidecar file of the same name; copy them to the new computer. It is advisable to verify that the sidecar matches the package before importing.
  2. New Computer: Install DSH and this plugin (the migration package includes a plugin/dsh-migrate/ copy, but it is recommended to install from this repository) → Settings → Backup & Migration → Import → Select package → Fill in New Root Directory → Optional “Pre-import Check” → Start Import.

After import, refresh the page. Projects, conversations, and files should be in new locations; old conversations can continue if the path rewriting is correct.

Old Computer: Export Options

  1. Enter Export (Old Computer) and check the workspaces (all selected by default).
  2. Check “Package project files together” or “Package image attachments together” as needed; without project files, only the conversation is packaged.
  3. If the export location is left blank, the profile configuration item defaultOutDir is used; if not configured, it falls back to ~/.dsh/migrations/. After completion, copy both <package-name>.zip and <package-name>.zip.sha256 files.

When packaging project files, directories like node_modules, .git, .venv, __pycache__ (which can be rebuilt) are excluded. The export directory cannot be inside the project being exported; otherwise, files for that project will be skipped and a warning will be shown.

New Computer: Import and Path Rewriting

  1. Select the migration package and read the manifest.
  2. Fill in Import to (New Root Directory), for example E:\DSH; each project is created under E:\DSH\<project-name> by default, but can be modified line by line in the list.
  3. Execute the import after checking Rewrite old paths mentioned in the conversation by default.

Tool calls, file references, and errors in the conversation often contain absolute paths from the old machine. If you migrate the working directory without rewriting, the model will point to non-existent files when continuing the chat. The import will replace occurrences of the remapped root path in the event data with the new path and provide metrics such as the number of rewrites in the report.

Sessions with the same ID prioritize “fast-forward merge” under the rules described in the documentation: if the local log is a strict prefix of the session in the package, only the tail events are appended; cases where the session is already up-to-date, forked, or in use will be skipped and noted in the report. If you need to strictly rollback the appended part, the documentation suggests backing up ~/.dsh/sessions yourself before importing.

Pre-import Check

If the attachments referenced by a conversation are missing locally in ~/.dsh/attachments when continuing a chat, the preparation phase may fail. The Pre-import Check on the import page scans attachment references in each session within the package and reports the number of missing attachments and the involved sessions. If attachments were not included during export, you can copy the entire ~/.dsh/attachments folder from the old machine to the same path on the new machine and restart DSH.

Incremental Sync (0.2.0+)

After the first export, you can use Incremental Update Existing Migration Package on the export page, selecting an existing package or entering a path. It only copies new or modified files and deletes files that were deleted in the source; unchanged sessions reuse data based on the byte count and event count of the source log. The scope of the increment is fixed to the workspaces originally contained in that package. Change detection relies on file size and modification time; changes in content that don’t alter either might not be recognized.

Re-import and Session Fast-forward (0.7.0+)

When both the old and new machines retain the same session, importing is no longer skipped uniformly: if the local timeline is a prefix of the session in the package, the tail is appended; if the local is already up-to-date, it is skipped; if continuing the chat on both ends causes a fork, it is skipped and labeled; if the session is in use, it is skipped. Appending uses the public sessionPersistence channel; the appended events cannot be reverted using “Undo this import”.

Capabilities and Boundaries

  • Write & Delete: Creating sessions and registrations via sessionPersistence / workspaceRegistry; “Undo this import” only deletes project registrations and session directories created by this plugin within the current process.
  • Authentication: Requests are validated by the host ctx.connection.requestRejection(); returns 503 if the service is unavailable.
  • Privacy: Migration includes complete conversations and project files; the export location should not be placed in a publicly accessible directory.

Other interface capabilities: “Clean up invalid projects” on the export page can delete project registrations where the path no longer exists and there are no sessions.

Limitations and Use Cases

Suitable for developers who need to move DSH workspaces project-by-project between multiple machines and want old conversations to continue under new paths. The limitations listed in the documentation include:

  • Migration package log formats are directional: packages exported by older versions can be imported by newer versions (backend auto-migration), but the reverse is not true; when there is a large version gap between the two DSH versions, it is recommended to upgrade the old machine to match the target machine before exporting.
  • Credentials are not migrated; you need to log in again on the new machine.
  • Plugin combinations in ~/.dsh/profiles/* will not be automatically restored; you need to reinstall plugins on the new machine (the package only contains a copy of this plugin).

The plugin reads and writes the above directories under the local DSH process permissions; it is advisable to view the source code and MIT license on the GitHub repository before installing. The community plugin directory is a separate site with no official affiliation with DeepSeek / Fantuan.

Conclusion

dsh-workspace-migrate turns “Select workspace → Zip package → New machine fills new root directory and imports” into a fixed process in settings, and uses path rewriting and incremental capabilities to reduce the problem of conversations being unusable after changing machines. For plugin introduction and installation instructions, see SkillHub Directory Page and GitHub: jockerbear/dsh-workspace-migrate.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye