If, for any reason, you need to roll back to the previous version of Harbor, perform the following steps.
To roll back from an upgrade, you must have backed up the previous version of Harbor. For information about backing up Harbor before an upgrade, see Upgrade Harbor and Migrate Data.
Harbor 2.2 is compiled by Golang 1.15 which deprecated self signed certificate without SAN. If you enabled internal TLS and cert files are generated by Harbor prepare script, you must generate the internal certificates again, using command like this docker run -v /:/hostfs goharbor/prepare:v2.2.0 gencert -p /path/to/internal/tls/cert
The certs generated by the old version prepare script didn’t include the SAN extension. If you manage the certs file, make the SAN is included, if not please check Configure Internal TLS communication between Harbor Component. For more information about Go’s break please refer release note of Go 1.5 and this issue.
Stop and remove the current Harbor service if it is still running.
cd harbor
docker-compose down
Remove current Harbor instance.
rm -rf harbor
Restore the older version of Harbor.
mv /my_backup_dir/harbor harbor
To restore the database, copy the data files from the backup directory to your data volume, which by default is
/data/database
.Restart the Harbor service using the previous configuration.
If the previous version of Harbor was installed by a release build:
cd harbor
./install.sh
While you can roll back an upgrade to the state before you started the upgrade, Harbor does not support downgrades.