Updated upgrade doc

This commit is contained in:
Stuart Clements 2020-01-13 16:05:58 +01:00
parent 62673be6da
commit bc25f28b2c
5 changed files with 45 additions and 38 deletions

View File

@ -6,7 +6,7 @@
When you delete images from Harbor, space is not automatically freed up. You must run garbage collection to free up space by removing blobs that are no longer referenced by a manifest from the file system.
### Run Garbage Collection
## Run Garbage Collection
1. Log in to the Harbor interface with an account that has Harbor system administrator privileges.
1. Expand **Administration**, and select **Garbage Collection**.
@ -18,7 +18,7 @@ When you run garbage collection, Harbor goes into read-only mode. All modificati
To avoid triggering the garbage collection process too frequently, the availability of the **GC Now** button is restricted. Garbage collection can be only run once per minute.
### Schedule Garbage Collection
## Schedule Garbage Collection
1. Expand **Administration**, and select **Garbage Collection**.
1. Select the **'Garbage Collection'** tab.

View File

@ -1,6 +1,10 @@
[Back to table of contents](../../index.md)
----------
# Roll Back from an Upgrade
If, for any reason, you want to roll back to the previous version of Harbor, perform the following steps:
If, for any reason, you need to roll back to the previous version of Harbor, perform the following steps.
1. Stop and remove the current Harbor service if it is still running.
@ -15,20 +19,25 @@ If, for any reason, you want to roll back to the previous version of Harbor, per
rm -rf harbor
```
3. Restore the older version package of Harbor.
3. Restore the older version of Harbor.
```sh
mv /my_backup_dir/harbor harbor
```
4. Restore database, copy the data files from backup directory to you data volume, by default `/data/database`.
4. To restore the database, copy the data files from the backup directory to your data volume, which by default is `/data/database`.
5. Restart Harbor service using the previous configuration.
If previous version of Harbor was installed by a release build:
5. Restart the Harbor service using the previous configuration.
If the previous version of Harbor was installed by a release build:
```sh
cd harbor
./install.sh
```
**NOTE**: While you can roll back an upgrade to the state before you started the upgrade, Harbor does not support downgrades.
**NOTE**: While you can roll back an upgrade to the state before you started the upgrade, Harbor does not support downgrades.
----------
[Back to table of contents](../../index.md)

View File

@ -1,71 +1,71 @@
[Back to table of contents](../../index.md)
----------
# Upgrade Harbor and Migrate Data
This guide covers upgrade and migration to version 1.9.0. This guide only covers migration from v1.7.x and later to the current version. If you are upgrading from an earlier version, refer to the migration guide in the `release-1.7.0` branch to upgrade to v1.7.x first, then follow this guide to perform the migration to this version.
This guide covers upgrade and migration to version 1.10.0. This guide only covers migration from v1.8.x and later to the current version. If you are upgrading from an earlier version, refer to the migration guide in the `release-1.8.0` branch to upgrade to v1.8.x first, then follow this guide to perform the migration to this version.
When upgrading an existing Harbor 1.7.x instance to a newer version, you might need to migrate the data in your database and the settings in `harbor.cfg`.
When upgrading an existing Harbor instance to a newer version, you might need to migrate the data in your database and the settings in `harbor.cfg`.
Since the migration might alter the database schema and the settings of `harbor.cfg`, you should **always** back up your data before any migration.
**NOTES:**
- Again, you must back up your data before any data migration.
- Since v1.8.0, the configuration of Harbor has changed to a `.yml` file. If you are upgrading from 1.7.x, the migrator will transform the configuration file from `harbor.cfg` to `harbor.yml`. The command will be a little different to perform this migration, so make sure you follow the steps below.
- In version 1.9.0, some containers are started by `non-root`. This does not pose problems if you are upgrading an officially released version of Harbor, but if you have deployed a customized instance of Harbor, you might encounter permission issues.
- In previous releases, user roles took precedence over group roles in a project. In this version, user roles and group roles are combined so that the user has whichever set of permissions is highest. This might cause the roles of certain users to change during upgrade.
- With the introduction of storage and artifact quotas in version 1.9.0, migration from 1.7.x and 1.8.x might take a few minutes. This is because the `core` walks through all blobs in the registry and populates the database with information about the layers and artifacts in projects.
- With the introduction of storage and artifact quotas in version 1.9.0, migration from 1.8.x might take a few minutes. This is because the `core` walks through all blobs in the registry and populates the database with information about the layers and artifacts in projects.
- With the introduction of storage and artifact quotas in version 1.9.0, replication between version 1.9.0 and a previous version of Harbor does not work. You must upgrade all Harbor nodes to 1.9.0 if you have configured replication between them.
## Upgrading Harbor and Migrating Data
1. Log in to the host that Harbor runs on, stop and remove existing Harbor instance if it is still running:
1. Log in to the Harbor host and, if it is still running, stop and remove the existing Harbor instance.
```sh
cd harbor
docker-compose down
```
2. Back up Harbor's current files so that you can roll back to the current version if necessary.
1. Back up Harbor's current files so that you can roll back to the current version if necessary.
```sh
mv harbor /my_backup_dir/harbor
```
Back up database (by default in directory `/data/database`)
1. Back up the database, which by default is in the directory `/data/database`.
```sh
cp -r /data/database /my_backup_dir/
```
3. Get the latest Harbor release package from Github:
[https://github.com/goharbor/harbor/releases](https://github.com/goharbor/harbor/releases)
1. Get the latest Harbor release package from [https://github.com/goharbor/harbor/releases](https://github.com/goharbor/harbor/releases)
1. Before upgrading Harbor, perform migration.
4. Before upgrading Harbor, perform migration first. The migration tool is delivered as a docker image.
You can pull the image from docker hub. Replace [tag] with the release version of Harbor (e.g. v1.5.0) in the below command:
The migration tool is delivered as a docker image. You can pull the image from docker hub. Replace [tag] with the new Harbor version, for example v1.10.0, in the following command:
```sh
docker pull goharbor/harbor-migrator:[tag]
```
Alternatively, if you are using an offline installer package you can load it from the image tarball included in the offline installer package. Replace [version] with the release version of Harbor (e.g. v1.5.0) in the below command:
Alternatively, if you are using an offline installer package, you can load it from the image tarball that is included in the offline installer package. Replace [tag] with the new Harbor version, for example v1.10.0, in the following command:
```sh
tar zxf <offline package>
docker image load -i harbor/harbor.[version].tar.gz
```
5. If you are current version is v1.7.x or earlier, i.e. migrate config file from `harbor.cfg` to `harbor.yml`.
**NOTE:** You can find the ${harbor_yml} in the extracted installer you got in step `3`, after the migration the file `harbor.yml`
in that path will be updated with the values from ${harbor_cfg}
```sh
docker run -it --rm -v ${harbor_cfg}:/harbor-migration/harbor-cfg/harbor.yml -v ${harbor_yml}:/harbor-migration/harbor-cfg-out/harbor.yml goharbor/harbor-migrator:[tag] --cfg up
```
Otherwise, If your version is 1.8.x or higher, just upgrade the `harbor.yml` file.
1. Upgrade the `harbor.yml` file.
```sh
docker run -it --rm -v ${harbor_yml}:/harbor-migration/harbor-cfg/harbor.yml goharbor/harbor-migrator:[tag] --cfg up
```
**NOTE:** The schema upgrade and data migration of the database is performed by core when Harbor starts, if the migration fails, please check the log of core to debug.
**NOTE:** The schema upgrade and data migration of the database is performed by core when Harbor starts. If the migration fails, check the core log to debug.
6. Under the directory `./harbor`, run the `./install.sh` script to install the new Harbor instance. If you choose to install Harbor with components such as Notary, Clair, and chartmuseum, refer to [Installation & Configuration Guide](../docs/installation_guide.md) for more information.
1. In the `./harbor` directory, run the `./install.sh` script to install the new Harbor instance.
To install Harbor with components such as Notary, Clair, and chartmuseum, see [Run the Installer Script](../../install_config/run_installer_script.md) for more information.
----------
[Back to table of contents](../../index.md)

View File

@ -1,7 +1,4 @@
This guide is for Harbor upgrade test
=======
# Before upgrade
# Test Harbor Upgrade
## Prepare data
1. Add user usera userb userc userd usere, set usera userb as system admin.
@ -41,4 +38,4 @@ This guide is for Harbor upgrade test
9. Confirm scan result the same as before upgrade.
10. Confirm access log the same as before upgrade.
11. Confirm repository info the same as before.
12. Confirm other image metadata(e.g. author, size) the same as before.
12. Confirm other image metadata(e.g. author, size) the same as before.

View File

@ -47,6 +47,7 @@ This section describes how to use and maintain Harbor after deployment. These da
- [Garbage Collection](administration/garbage_collection.md)
- [Upgrade Harbor and Migrate Data](administration/upgrade/upgrade_migrate_data.md)
- [Roll Back an Upgrade](administration/upgrade/roll_back_upgrade.md)
- [Test Harbor Upgrade](administration/upgrade/upgradetest.md)
## Working with Harbor Projects