moviepilot-update

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

MoviePilot System Update & Restart

MoviePilot 系统更新与重启

All script paths are relative to this skill file.
This skill provides capabilities to restart MoviePilot service, check for updates, and perform manual upgrades.
所有脚本路径均相对于此技能文件。
本技能提供重启MoviePilot服务、检查更新、执行手动升级的能力。

Restart MoviePilot

重启MoviePilot

Method 1: Using REST API (Recommended)

方法1:使用REST API(推荐)

Call the restart endpoint with admin authentication:
bash
undefined
使用管理员身份认证调用重启接口:
bash
undefined

Using moviepilot-api skill

Using moviepilot-api skill

python scripts/mp-api.py GET /api/v1/system/restart

Or with curl:
```bash
curl -X GET "http://localhost:3000/api/v1/system/restart" \
  -H "X-API-KEY: <YOUR_API_TOKEN>"
Note: This API will restart the Docker container internally. The service will be briefly unavailable during restart.
python scripts/mp-api.py GET /api/v1/system/restart

或者使用curl:
```bash
curl -X GET "http://localhost:3000/api/v1/system/restart" \
  -H "X-API-KEY: <YOUR_API_TOKEN>"
注意: 该API会在内部重启Docker容器,重启期间服务会短暂不可用。

Method 2: Using execute_command tool

方法2:使用execute_command工具

If you have admin privileges, you can execute the restart command directly:
bash
docker restart moviepilot
如果你拥有管理员权限,可以直接执行重启命令:
bash
docker restart moviepilot

Check for Updates

检查更新

Method 1: Using REST API

方法1:使用REST API

bash
python scripts/mp-api.py GET /api/v1/system/versions
This returns all available GitHub releases.
bash
python scripts/mp-api.py GET /api/v1/system/versions
该接口会返回所有可用的GitHub版本。

Method 2: Check current version

方法2:查看当前版本

bash
undefined
bash
undefined

Check current version

Check current version

cat /app/version.py
undefined
cat /app/version.py
undefined

Upgrade MoviePilot

升级MoviePilot

Option 1: Automatic Update (Recommended)

选项1:自动更新(推荐)

Set the environment variable
MOVIEPILOT_AUTO_UPDATE
and restart:
  1. For Docker Compose users:
    bash
    # Edit docker-compose.yml, add environment variable:
    environment:
      - MOVIEPILOT_AUTO_UPDATE=release  # or "dev" for dev版本
    
    # Then restart
    docker-compose down && docker-compose up -d
  2. For Docker run users:
    bash
    docker stop moviepilot
    docker rm moviepilot
    docker run -d ... -e MOVIEPILOT_AUTO_UPDATE=release jxxghp/moviepilot
The update script (
/usr/local/bin/mp_update.sh
or
/app/docker/update.sh
) will automatically:
  • Check GitHub for latest release
  • Download new backend code
  • Update dependencies if changed
  • Download new frontend
  • Update site resources
  • Restart the service
设置环境变量
MOVIEPILOT_AUTO_UPDATE
后重启服务:
  1. Docker Compose用户:
    bash
    # Edit docker-compose.yml, add environment variable:
    environment:
      - MOVIEPILOT_AUTO_UPDATE=release  # or "dev" for dev版本
    
    # Then restart
    docker-compose down && docker-compose up -d
  2. Docker run用户:
    bash
    docker stop moviepilot
    docker rm moviepilot
    docker run -d ... -e MOVIEPILOT_AUTO_UPDATE=release jxxghp/moviepilot
更新脚本(
/usr/local/bin/mp_update.sh
/app/docker/update.sh
)会自动执行以下操作:
  • 检查GitHub上的最新发行版
  • 下载新的后端代码
  • 若依赖有变更则更新依赖
  • 下载新的前端资源
  • 更新站点资源
  • 重启服务

Option 2: Manual Upgrade

选项2:手动升级

If you need to manually download and apply updates:
  1. Get latest release version:
    bash
    curl -s https://api.github.com/repos/jxxghp/MoviePilot/releases | grep '"tag_name"' | grep "v2" | head -1
  2. Download and extract backend:
    bash
    # Replace v2.x.x with actual version
    curl -L -o /tmp/backend.zip https://github.com/jxxghp/MoviePilot/archive/refs/tags/v2.x.x.zip
    unzip -d /tmp/backend /tmp/backend.zip
  3. Backup and replace:
    bash
    # Backup current installation
    cp -r /app /app_backup
    
    # Replace files (exclude config and plugins)
    cp -r /tmp/backend/MoviePilot-*/* /app/
  4. Restart MoviePilot:
    bash
    # Use API or docker restart
    python scripts/mp-api.py GET /api/v1/system/restart
如果你需要手动下载并应用更新:
  1. 获取最新发行版本:
    bash
    curl -s https://api.github.com/repos/jxxghp/MoviePilot/releases | grep '"tag_name"' | grep "v2" | head -1
  2. 下载并解压后端包:
    bash
    # Replace v2.x.x with actual version
    curl -L -o /tmp/backend.zip https://github.com/jxxghp/MoviePilot/archive/refs/tags/v2.x.x.zip
    unzip -d /tmp/backend /tmp/backend.zip
  3. 备份并替换文件:
    bash
    # Backup current installation
    cp -r /app /app_backup
    
    # Replace files (exclude config and plugins)
    cp -r /tmp/backend/MoviePilot-*/* /app/
  4. 重启MoviePilot:
    bash
    # Use API or docker restart
    python scripts/mp-api.py GET /api/v1/system/restart

Important Notes

重要注意事项

  • Backup first: Before upgrading, backup your configuration and database
  • Dependencies: Check if requirements.in has changes; if so, update virtual environment
  • Plugins: The update script automatically backs up and restores plugins
  • Non-Docker: For non-Docker installations, use
    git pull
    or
    pip install -U moviepilot
  • 优先备份: 升级前请备份你的配置文件和数据库
  • 依赖处理: 检查requirements.in是否有变更,如有则更新虚拟环境
  • 插件处理: 更新脚本会自动备份并恢复插件
  • 非Docker安装: 非Docker部署的用户可以使用
    git pull
    pip install -U moviepilot
    升级

Troubleshooting

故障排查

IssueSolution
Restart failsCheck if Docker daemon is running; verify container has restart policy
Update failsCheck network connectivity to GitHub; ensure sufficient disk space
Version unchangedVerify
MOVIEPILOT_AUTO_UPDATE
environment variable is set correctly
Dependency errorsMay need to rebuild virtual environment:
pip-compile requirements.in && pip install -r requirements.txt
问题解决方案
重启失败检查Docker守护进程是否正常运行,确认容器配置了重启策略
更新失败检查到GitHub的网络连接是否正常,确保磁盘空间充足
版本未更新确认
MOVIEPILOT_AUTO_UPDATE
环境变量配置正确
依赖报错可能需要重新构建虚拟环境:
pip-compile requirements.in && pip install -r requirements.txt

Environment Variables for Auto-Update

自动更新相关环境变量

VariableValueDescription
MOVIEPILOT_AUTO_UPDATE
release
Auto-update to latest stable release
MOVIEPILOT_AUTO_UPDATE
dev
Auto-update to latest dev version
MOVIEPILOT_AUTO_UPDATE
false
Disable auto-update (default)
GITHUB_TOKEN
(token)GitHub token for higher rate limits
GITHUB_PROXY
(url)GitHub proxy URL for China users
PROXY_HOST
(url)Global proxy host
变量取值说明
MOVIEPILOT_AUTO_UPDATE
release
自动更新到最新稳定版
MOVIEPILOT_AUTO_UPDATE
dev
自动更新到最新开发版
MOVIEPILOT_AUTO_UPDATE
false
关闭自动更新(默认值)
GITHUB_TOKEN
(token)GitHub token,用于提升请求速率上限
GITHUB_PROXY
(url)面向国内用户的GitHub代理地址
PROXY_HOST
(url)全局代理地址