Migrate From CPA-Manager
Use this guide when migrating from the old seakee/cpa-manager / CPA-Manager project to seakee/cpa-manager-plus. The goal is to keep historical request statistics, model prices, API Key aliases, and saved CPA connection configuration.
Key Changes
- The image name changed from
seakee/cpa-managertoseakee/cpa-manager-plus. - Native packages and binaries changed from
cpa-managertocpa-manager-plus. - The backend directory changed from the old project's
usage-servicetoapps/manager-server; compatibility endpoints under/usage-service/*are still kept. - Full Docker login changed from CPA Management Key to the Manager Server admin key
cmp_admin_.... - The CPA Management Key is encrypted with
/data/data.keybefore being saved to SQLite. - Old
settings.setupdata is migrated tosettings.manager_config_v1and kept as compatibility data.
Before Migration
- Check the CPA version:
v7.1.0+is recommended, and HTTP usage queue needs at leastv6.10.8+. - Locate the old Manager Server data:
- Docker volume is commonly
cpa-manager-data. - Host directory mounts usually map to container
/data. - Native packages default to
data/usage.sqliteunder the program directory.
- Docker volume is commonly
- Stop the old container or process so SQLite WAL files stop changing.
- Back up the whole old data directory. Keep at least:
usage.sqliteusage.sqlite-walusage.sqlite-shm
- Decide the admin key strategy. During migration, explicitly setting
CPA_MANAGER_ADMIN_KEYorCPA_MANAGER_ADMIN_KEY_FILEis recommended.
Docker Volume Migration
A typical old Compose service looks like:
services:
cpa-manager:
image: seakee/cpa-manager:latest
volumes:
- cpa-manager-data:/data
volumes:
cpa-manager-data:During migration, Plus can mount the old volume directly:
services:
cpa-manager-plus:
image: seakee/cpa-manager-plus:latest
restart: unless-stopped
ports:
- "18317:18317"
environment:
HTTP_ADDR: "0.0.0.0:18317"
USAGE_DB_PATH: "/data/usage.sqlite"
CPA_MANAGER_DATA_KEY_PATH: "/data/data.key"
CPA_MANAGER_ADMIN_KEY: "replace-with-a-long-random-admin-key"
USAGE_COLLECTOR_MODE: "auto"
volumes:
- cpa-manager-data:/data
volumes:
cpa-manager-data:
external: trueNote: the Plus example Compose file creates cpa-manager-plus-data by default. If you use that new empty volume, the panel will look like a fresh install and will not show old data.
Host Directory Migration
docker stop cpa-manager
cp -a /srv/cpa-manager-data /srv/cpa-manager-data.backup
docker run -d \
--name cpa-manager-plus \
--restart unless-stopped \
-p 18317:18317 \
-v /srv/cpa-manager-data:/data \
-e CPA_MANAGER_ADMIN_KEY='replace-with-a-long-random-admin-key' \
seakee/cpa-manager-plus:latestAfter startup, open http://<host>:18317/management.html and log in with the admin key.
Native Package Migration
- Stop the old
cpa-managerprocess. - Back up the old program directory, especially
data/usage.sqlite*. - Extract
cpa-manager-plus_<version>_<os>_<arch>. - Copy the old
datadirectory into the new package directory, or setUSAGE_DATA_DIR/USAGE_DB_PATHto the old data directory. - Set an admin key for the first startup:
CPA_MANAGER_ADMIN_KEY='replace-with-a-long-random-admin-key' ./cpa-manager-plusVerify After First Startup
- Check startup logs and confirm there are no
decrypt secret,open sqlite, orbootstrap manager servererrors. - Open the panel and go to the configuration page.
- Check the CPA URL, request monitoring toggle, collection mode, and polling interval.
- Open the dashboard or monitoring page and confirm historical data is visible.
- Request
/statusand confirm collector status,lastConsumedAt,lastInsertedAt, andlastError. - Back up the migrated
/data; it must now include the newly generateddata.key.
Rollback
Stop Plus before rollback. The old CPA-Manager can still read the main usage tables and old settings.setup, but it cannot understand the new admin credential, bootstrap state, or encrypted data key. Prefer rolling back to the pre-migration backup.
FAQ
- Old data is missing after migration: usually the deployment mounted a new empty
cpa-manager-plus-datavolume instead of the oldcpa-manager-data. - Login always returns 401: Manager Server APIs need the admin key; CPA Management Key is only for logging in to the CPA control panel.
- Monitoring is empty: confirm CPA usage publishing is enabled, the collection mode matches the network path, and only one Manager Server consumes the usage queue for the same CPA instance.
- Decryption fails: confirm
/data/data.keywas not lost or replaced after migration.