ref: https://github.com/goharbor/harbor/blob/release-1.2.0/docs/migration_guide.md
本文仅摘取关键差异部分;
NOTE:
- From v1.2 on, you need to use the release version as the tag of the migrator image. 'latest' is no longer used for new release.
- You must back up your data before any data migration.
The migration tool is delivered as a docker image, so you should pull the image from docker hub. Replace
[tag]
with the release version of Harbor (e.g. 1.2) in the below command:
docker pull vmware/harbor-db-migrator:[tag]
- Configure Harbor by modifying the file
harbor.cfg
, you may need to refer to the configuration files you've backed up during step 2. Refer to Installation & Configuration Guide for more information. Since the content and format ofharbor.cfg
may have been changed in the new release, DO NOT directly copyharbor.cfg
from previous version of Harbor.
IMPORTANT: If you are upgrading a Harbor instance with LDAP/AD authentication, you must make sure
auth_mode
is set toldap_auth
inharbor.cfg
before launching the new version of Harbor. Otherwise, users may not be able to log in after the upgrade.
- To assist you in migrating the
harbor.cfg
file from v0.5.0 to v1.1.x, a script is provided and described as below. For other versions of Harbor, you need to manually migrate the fileharbor.cfg
.
cd harbor
./upgrade --source-loc source_harbor_cfg_loc --source-version 0.5.0 --target-loc target_harbor_cfg_loc --target-version 1.1.x
NOTE: After running the script, make sure you go through
harbor.cfg
to verify all the settings are correct. You can make changes toharbor.cfg
as needed.
Use
help
command to show instructions of the migration tool:
docker run --rm -e DB_USR=root -e DB_PWD=xxxx vmware/harbor-db-migrator:[tag] help