首页龙虾技能列表 › ollama-migrator — ollama-migrator工具

ollama-migrator — ollama-migrator工具

v1.0.0

Ollama 模型迁移技能。用于将 Ollama 模型从 C 盘迁移到其他磁盘,释放 C 盘空间。使用场景:(1) C 盘空间不足需要迁移模型,(2) 更换模型存储位置,(3) 检查 Ollama 模型占用空间,(4) 验证迁移后模型可用性

0· 170·0 当前·0 累计
by @jjflydudu (test_heng)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/15
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
The skill's code and instructions are consistent with its stated purpose (migrating local Ollama model files); it does not attempt network exfiltration and its actions are proportionate, but there are small documentation/dependency mismatches you should review before use.
评估建议
This skill appears to do what it says: move local Ollama model files, set OLLAMA_MODELS, and verify with the local 'ollama' CLI. Before installing/run it: 1) Confirm you're on Windows (the scripts use taskkill and winreg). 2) Ensure you have Python and the 'ollama' CLI available and working. 3) Inspect the scripts (they are included) and run the check mode first: python scripts/migrate_ollama.py --check (or python scripts/check_ollama_status.py) to preview results. 4) Note SKILL.md mentions scri...
详细分析 ▾
用途与能力
The name/description (migrating Ollama models off C:) match the scripts' behavior: scanning model folder, copying files, stopping Ollama, setting OLLAMA_MODELS, verifying via 'ollama list', and optional cleanup. Incoherences: SKILL.md references a scripts/verify_ollama.py that is not present, and the metadata declares no required binaries/commands even though the scripts call external commands ('ollama', 'taskkill'). These are documentation omissions but not functionality mismatches.
指令范围
Runtime instructions and scripts stay within the migration scope: they read model files under the user's home (~/.ollama/models), check disk usage, copy files, set a user environment variable, stop a specific process (ollama.exe) and optionally remove the source. They do modify the user registry (user-level env var) and kill a process, which is expected for this task but worth noting. There are no network calls or attempts to read unrelated system secrets.
安装机制
No install spec is provided and the skill is effectively instruction + helper scripts. That minimizes installer risk. The scripts will run on the host via Python; nothing is downloaded or extracted by an installer.
凭证需求
The skill does not request external credentials and only uses/sets the OLLAMA_MODELS environment variable — appropriate for changing model location. Minor mismatch: registry/system-level environment variables are discussed in SKILL.md, but the code only writes a user-level environment variable (HKEY_CURRENT_USER). Also the skill assumes availability of 'ollama' CLI and Windows utilities but does not declare them as required.
持久化与权限
The skill does not request permanent/always-on privileges and will not modify other skills or system-wide agent settings. It does persist a user-level environment variable (expected for this purpose) and may delete source files only when you explicitly pass --cleanup and confirm.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/3/15

--- name: ollama-migrator description: Ollama 模型迁移技能。用于将 Ollama 模型从 C 盘迁移到其他磁盘,释放 C 盘空间。使用场景:(1) C 盘空间不足需要迁移模型,(2) 更换模型存储位置,(3) 检查 Ollama 模型占用空间,(4) 验证迁移后模型可用性 --- # Ollama 模型迁移助手 本技能帮助将 Ollama 模型安全迁移到其他磁盘,释放 C 盘空间。 ## 核心能力 ### 1. 空间分析 - 检查当前模型存储位置 - 计算模型总占用空间 - 检查目标磁盘可用空间 ### 2. 安全迁移 - 停止 Ollama 服务 - 复制模型文件(保留完整性) - 设置环境变量 - 验证迁移结果 ### 3. 回滚支持 - 保留源文件直到验证完成 - 支持手动回滚 - 迁移日志记录 ## 工作流程 ### 步骤 1: 检查状态 ```powershell # 检查当前模型位置和大小 python scripts/check_ollama_status.py ``` ### 步骤 2: 执行迁移 ```powershell # 迁移到 D 盘(默认) python scripts/migrate_ollama.py --target D:\Ollama\models # 迁移到其他位置 python scripts/migrate_ollama.py --target E:\AI\models ``` ### 步骤 3: 验证 ```powershell # 验证模型列表 ollama list # 测试运行模型 ollama run qwen3.5:9b ``` ### 步骤 4: 清理(可选) 确认迁移成功后,删除旧文件: ```powershell python scripts/migrate_ollama.py --cleanup ``` ## 环境变量 迁移后设置的环境变量: - **用户级**: `OLLAMA_MODELS = <目标路径>` - **系统级**: 需要管理员权限(可选) ## 脚本工具 - `scripts/check_ollama_status.py` - 检查 Ollama 状态和模型占用 - `scripts/migrate_ollama.py` - 执行迁移操作 - `scripts/verify_ollama.py` - 验证迁移结果 ## 触发条件 当用户提到: - "Ollama 迁移" - "Ollama 模型移动到其他盘" - "C 盘 Ollama 占用太大" - "Ollama 模型位置" - "迁移 Ollama 到 D 盘" ## 安全机制 ### 必须遵守的规则 1. **迁移前检查**: - 确认 Ollama 服务已停止 - 检查目标磁盘空间充足 - 记录当前模型列表 2. **数据完整性**: - 使用可靠复制(验证大小) - 保留源文件直到验证完成 - 迁移日志记录 3. **用户确认**: - 显示迁移计划 - 用户明确确认后才执行 - 支持预览模式 4. **验证机制**: - 迁移后自动验证模型列表 - 测试运行一个模型 - 确认无误后才建议清理 ## 注意事项 1. **新终端窗口**:环境变量在新打开的终端中生效 2. **运行中的服务**:需要重启 Ollama 服务 3. **权限问题**:系统级环境变量需要管理员权限 4. **备份建议**:重要模型建议先备份

● 无害

安装命令 点击复制

官方npx clawhub@latest install ollama-migrator
镜像加速npx clawhub@latest install ollama-migrator --registry https://cn.clawhub-mirror.com

技能文档

本技能帮助将 Ollama 模型安全迁移到其他磁盘,释放 C 盘空间。

核心能力

1. 空间分析

  • 检查当前模型存储位置
  • 计算模型总占用空间
  • 检查目标磁盘可用空间

2. 安全迁移

  • 停止 Ollama 服务
  • 复制模型文件(保留完整性)
  • 设置环境变量
  • 验证迁移结果

3. 回滚支持

  • 保留源文件直到验证完成
  • 支持手动回滚
  • 迁移日志记录

工作流程

步骤 1: 检查状态

# 检查当前模型位置和大小
python scripts/check_ollama_status.py

步骤 2: 执行迁移

# 迁移到 D 盘(默认)
python scripts/migrate_ollama.py --target D:\Ollama\models

# 迁移到其他位置 python scripts/migrate_ollama.py --target E:\AI\models

步骤 3: 验证

# 验证模型列表
ollama list

# 测试运行模型 ollama run qwen3.5:9b

步骤 4: 清理(可选)

确认迁移成功后,删除旧文件:
python scripts/migrate_ollama.py --cleanup

环境变量

迁移后设置的环境变量:

  • 用户级: OLLAMA_MODELS = <目标路径>
  • 系统级: 需要管理员权限(可选)

脚本工具

  • scripts/check_ollama_status.py - 检查 Ollama 状态和模型占用
  • scripts/migrate_ollama.py - 执行迁移操作
  • scripts/verify_ollama.py - 验证迁移结果

触发条件

当用户提到:

  • "Ollama 迁移"
  • "Ollama 模型移动到其他盘"
  • "C 盘 Ollama 占用太大"
  • "Ollama 模型位置"
  • "迁移 Ollama 到 D 盘"

安全机制

必须遵守的规则

  • 迁移前检查
- 确认 Ollama 服务已停止 - 检查目标磁盘空间充足 - 记录当前模型列表

  • 数据完整性
- 使用可靠复制(验证大小) - 保留源文件直到验证完成 - 迁移日志记录

  • 用户确认
- 显示迁移计划 - 用户明确确认后才执行 - 支持预览模式

  • 验证机制
- 迁移后自动验证模型列表 - 测试运行一个模型 - 确认无误后才建议清理

注意事项

  • 新终端窗口:环境变量在新打开的终端中生效
  • 运行中的服务:需要重启 Ollama 服务
  • 权限问题:系统级环境变量需要管理员权限
  • 备份建议:重要模型建议先备份
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务