dsh-backup-sync: DSH Backup, Migration, and Three-way Module Merge Import

Introduction

Assets in DeepSeek Harness (DSH) are not located in a single directory: skills are in ~/.agents/skills, while plugin manifests, core configurations, memories, todos, and conversations are scattered across ~/.dsh (default <dshHome>) and its profile subdirectories. When switching computers or reinstalling, skills and configurations are the most easily lost, yet a full “extract and overwrite” restoration often risks overwriting content already modified on the new machine.

There are mature full-backup plugins in the community (e.g., @xiaoyuyu6420/dsh-backup), but their skills type points to ~/.dsh/skills, which is inconsistent with the standard path where skills actually reside. Maintainer Arlenman’s dsh-backup-sync addresses this same need: it packages skills, plugins, configurations, memories, and todos (and optionally conversations) into a tar.gz. When switching machines, it performs a three-way merge import with a baseline for each module and can also push the package to a self-hosted WebDAV space. The plugin is categorized as “Memory” on SkillHub. The repository Arlenman/dsh-backup-sync uses the MIT license, and the current npm version is 0.2.0.

What is this

dsh-backup-sync is a backup / restore / machine-switching sync plugin for DSH: it normalizes the aforementioned assets into a single package. Upon import, it performs a three-way merge (base / ours / theirs) based on a locally maintained baseline database, provides per-file diffs, and lets you choose which side to keep in case of conflicts, rather than simply overwriting. It can be installed alongside dsh-backup (the backup directories and state file names differ, so they do not interfere with each other).

Runtime requirements: DSH 0.2.0-rc.2, Node.js ≥ 22; the package has zero npm runtime dependencies, and the archiving step uses the system’s built-in tar.

Core Features

Six Backup Modules

The plugin divides assets into six modules based on “file patterns” (memories and todos coexist under memories/, so it won’t mistakenly slice by entire directories):

Module UI Name Main Path Selected by Default
skills Skills <userHome>/.agents/skills Yes
plugins Plugins <dshHome>/profiles/<profile>/ manifests and lock files Yes
config Config cordis.patch.yml, settings.yaml, AGENTS.md, etc. Yes
memory Memory <dshHome>/memories/ (excluding todo files) Yes
todo Todo TODOS-*.md, projects/*/TODOS.md, etc. Yes
sessions Conversations <dshHome>/sessions/ No (marked “Local Only · Do Not Sync”)

Interface and Workflow

The entry point is in Settings → Backup Sync, featuring four tabs:

  1. Backup: Check modules, specify the output directory, and generate dsh-sync-<timestamp>.tar.gz along with a .sha256 sidecar file; cards display a human-readable list of skills/plugins, etc.
  2. History: List packages in the output directory, with options to verify, import, or copy the path.
  3. Import: Select package → Scan → Diff preview (Added / Modified / Deleted / Conflicts) → Adjudicate item by item → Apply; an automatic snapshot is taken to <output dir>/pre-restore-<timestamp>/ before applying.
  4. Sync: Push the package to a “Sync Directory” (a local path syncable by tools like OneDrive or Jintan Cloud), and support WebDAV upload, list, download, and delete.

Incremental Import and Baselines

Local state is saved in <dshHome>/backup-sync/state.json (the sha256 of each file at the time of the last pack, i.e., the base for merging). Typical rules include: if only the archive side changed, adopt the package version; if only the local side changed, keep local; if both sides changed and content differs, it is a conflict (preview provided); deletion is disabled by default (allowDelete is false). Credential files are excluded on both the scan and import sides, so they will not enter the package or be written back locally.

Scheduling and Cloud

Scheduled backups run within the DSH host process (at a fixed time daily or every N hours); if DSH is not running, missed backups are not run later, and failures are not retried. The conversation module is not included in scheduled packages.

WebDAV configuration (address, account, password, and remote directory) is done on the “Sync” page, with a “Save and Test Connection” option, and automatic upload can be selected after successful packing. When switching machines, install the plugin on the new machine, fill in the same WebDAV settings, and select the package from the “Cloud” group on the “Import” page; packages not present locally will be automatically downloaded and sha256-verified before “Analyze Diff”.

Installation and Activation

The following commands are from the repository README; the desktop version allows pasting equivalent entries in Settings → Plugins.

# Install from npm (0.2.0, no GitHub connection needed)
dsh plugin --profile web add dsh-backup-sync

# Install from GitHub (recommended to lock tag for reproducibility)
dsh plugin --profile web add github:Arlenman/dsh-backup-sync#v0.2.0

# Follow the main branch
dsh plugin --profile web add github:Arlenman/dsh-backup-sync

# Or use the tar.gz from the release directly
dsh plugin --profile web add https://github.com/Arlenman/dsh-backup-sync/releases/download/v0.2.0/dsh-backup-sync-0.2.0.tgz

When switching to another computer, the README suggests prioritizing:

github:Arlenman/dsh-backup-sync#v0.2.0

After installation, a DSH restart is required (host-side HTTP routes do not hot-reload); for the UI side, simply refresh the page. When installing from GitHub, the target machine must be able to access github.com and codeload.github.com.

Typical Usage

Creating the First Package on a Local Machine

  1. Open Settings → Backup Sync → Backup, check the modules as needed (for the first time, it is recommended to keep defaults; you may leave “Conversations” unchecked).
  2. Confirm or modify the output directory (default is mostly <userHome>/dsh-backups-sync, or D:\dsh-backups-sync on Windows under specific conditions).
  3. Execute the backup and confirm in “History” that the package and sha256 file have been generated.

Incremental Import for Machine Switching

  1. Install the plugin on the new machine as described above and restart DSH.
  2. Copy the backup package to the local output directory, or ensure the package appears in the history list via WebDAV / sync directory.
  3. On the Import page, select the package → Analyze Diff → Handle conflict items → Apply. If you need to sync “Deletions,” enable allowDelete in settings first.

WebDAV Machine Switching (Brief)

  1. On the old machine, configure WebDAV on the Sync page and upload the latest package.
  2. On the new machine, install the same plugin and fill in the same WebDAV and remote directory.
  3. In the Import backup package dropdown, select the cloud entry, analyze the diff, and apply.

The package uses a normalized layout: dsh/ corresponds to files under <dshHome>, agents/ corresponds to ~/.agents, and the root directory contains manifest.json (module list and per-file sha256).

Use Cases and Notes

This is suitable for users who need to carry over DSH skills, plugin locks, configurations, and memories/todos across machines while hoping to retain content modified on the new machine during import. If you only need a full restoration of the entire ~/.dsh tree or rely on GitHub private repo sync, you can continue to use dsh-backup; the two serve different purposes and can coexist.

Before installation, please review the source code and MIT license on the GitHub repository yourself. The plugin reads and writes local files and accesses your configured WebDAV with the current DSH process permissions. Passwords are stored in local settings and will not be written to the backup package. The README lists HTTP interfaces, known limitations, and development notes, which can be referred to when extending integrations.

Conclusion

dsh-backup-sync packages DSH’s core assets scattered in two locations into verifiable archives, uses baseline three-way merging to reduce the risk of overwriting during machine switches, and supports local sync directories and WebDAV. Plugin directory page: SkillHub - dsh-backup-sync; Source code and full documentation: github.com/Arlenman/dsh-backup-sync.

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

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

Xiaoye