Directly copying files for DSH Web configuration, plugin manifests, Skills, Presets, Storages, and private data can easily result in a broken environment due to path inconsistencies or missing dependencies. This plugin aims to package the aforementioned content into a password-protected .dsh-migrate file, supporting cross-machine migration.
Plugin Overview¶
- Name: dsh-data-migration
- Maintainer: hesixian
- License: MIT
- Core Function: Packages local configurations and dependencies into an encrypted file, then restores them on a new machine after a pre-check.
Installation & Activation¶
- Navigate to the project directory and install dependencies.
- Build the plugin.
- Add the local bundle to your DSH Web profile.
cd D:\code\dsh-data-migration
pnpm install
pnpm build
# Add local bundle to DSH Web profile
dsh plugin --profile web add link:D:\code\dsh-data-migration
Once installed, restart dsh web. You will find the DSH Data Migration option in the settings.
Core Capabilities¶
1. Export & Import¶
- Export: Supports selecting a save location via the system folder dialog or directly entering a full path to generate
backup.dsh-migrate. - Import: Supports selecting a
.dsh-migratefile or the folder containing it for automatic reading.
2. Security Pre-check¶
Before restoration, the plugin decrypts and validates the migration package. This process only displays a summary (export time, Profile, file count, API Key variable names, link dependencies, etc.) and does not modify any local configuration.
3. Confirm Restoration¶
- The restore button is enabled only after the sensitive data declaration checkbox is checked.
- A restore point is created for target files before restoration begins.
- If writing or environment variable setting fails, the system will automatically rollback.
4. Handling link: Dependencies¶
Many local plugins reference source code via link: and are typically not published to npm.
* Bundle Source Code: During export, you can choose to package the source code of link: dependencies. During restoration, it writes back to the original path (it will not overwrite if the directory already contains content).
* Path Redirection: If the drive letter of the source machine’s path does not exist on the new machine (e.g., the source has drive D but the new machine only has drive C), the pre-check will detect this and relocate the source code to <DSH Home Directory>\linked-plugins\<plugin-name>, simultaneously rewriting declarations in package.json and pnpm-lock.yaml.
5. Dependency Restoration & Validation¶
- Executes
pnpm install --frozen-lockfilefor profiles containingpnpm-lock.yaml. - Post-installation Validation: DSH’s resolution mechanism may create an illusion of “installed but unresolvable.” This plugin probes
dsh.profile.bundlesto distinguish and report separately on items that are “installed but unresolvable” versus “unverifiable.”
6. Security Model¶
- Encryption: Uses scrypt (N=32768, r=8, p=1) and AES-256-GCM encryption.
- Content Limitations: Only migrates
apiKeyEnvenvironment variables declared insettings.yaml. Does not migratenode_modules, pnpm store, sessions, attachments, or logs. - Access Control: Interface is restricted to local loopback addresses and same-origin requests; write operations only accept POST.
- Privacy Protection: The page does not display credentials, API Key values, or raw installation logs.
- Temporary Files: Plaintext credentials decrypted during the pre-check are stored in a temporary directory and deleted upon completion of restoration. If restoration is not performed within 30 minutes, residual files are cleaned up during the next pre-check.
Usage Steps¶
- Source Machine: Select a save folder (or enter a full
.dsh-migratepath), set a password of at least 12 characters, and click “Export.” - Transfer: Transfer the generated migration package to the new machine.
- Target Machine: After installing this plugin, select the migration package (file or folder) and enter the password, then click “Pre-check.”
- Confirm: Read the pre-check summary and check the box to confirm sensitive credentials. If
link:dependencies appear in the summary, please confirm that “The migration package carries the source code for the following plugins.” - Restore: Keep the “Automatically install profile dependencies” option selected as needed (for first-time migration, it is recommended to allow lifecycle scripts, otherwise some plugins may lack binaries or compiled modules), and click “Confirm and Restore.”
- Finish: Restart
dsh web.
Notes¶
- Backup Nature: The migration package is equivalent to a DSH identity backup. It should be stored on trusted offline media or encrypted storage. Do not forward it via public cloud drives or email.
- Environment Isolation: Does not migrate runtime data such as node_modules, sessions, attachments, etc.
- Permission Requirements: The plugin runs with the permissions of the current
dshprocess. Check the source code and license before installation.
Ecosystem & Links¶
This plugin is part of the DeepSeek Harness ecosystem. For more details, please refer to the GitHub Repository.