Upgrade
Standard pre-flight, mid-flight, and post-flight procedure.
Before
- Back up the database — see Backup & Restore.
- Read the CHANGELOG for the "Upgrade Notes" section of the target version.
- Check breaking changes — incompatible fields, endpoints, config keys.
Upgrade paths
Docker / docker-compose
bash
docker compose pull one-api-pro
docker compose up -dOnly the one-api-pro container restarts. Volumes (./data, ./mysql-data) are preserved.
Source build
bash
git pull
cd web/default-pro && pnpm install && pnpm build && cd ../..
go build -o one-api-pro .
systemctl stop one-api-pro
systemctl start one-api-proPre-built binary
Replace the binary, restart the service. Data files are unchanged.
During
AutoMigrate runs at startup — it adds tables / columns as needed. Watch the log:
[migrate] adding column foo.bar
[migrate] creating index idx_xxxIf it fails, look at the specific error (usually a column-type conflict).
After
- Re-read CHANGELOG "Upgrade Notes".
- Check Admin → Dashboard — compare success rates before/after.
- Sample a few call logs — confirm behavior is as expected.
- New features: some versions require manual config in Admin → System Settings (the CHANGELOG will mention it).
Rollback
If something goes badly wrong:
bash
# Docker
docker compose down
mv ./mysql-data ./mysql-data.broken
cp -r ./backup-YYYYMMDD/mysql-data ./
docker compose up -dIf the schema didn't change between versions, you can simply downgrade to the previous binary.