mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 12:15:20 +01:00
Merge pull request #1317 from hainingzhang/master
udpate migration guide
This commit is contained in:
commit
d786f12f11
@ -9,20 +9,20 @@ When upgrading your existing Habor instance to a newer version, you may need to
|
||||
|
||||
### Upgrading Harbor and migrating data
|
||||
|
||||
1. Log in to the machine that Harbor runs on, stop and remove existing Harbor service if it is still running:
|
||||
1. Log in to the host that Harbor runs on, stop and remove existing Harbor instance if it is still running:
|
||||
|
||||
```
|
||||
cd harbor
|
||||
docker-compose down
|
||||
```
|
||||
|
||||
2. Back up Harbor's current source code so that you can roll back to the current version when it is necessary.
|
||||
2. Back up Harbor's current files so that you can roll back to the current version when it is necessary.
|
||||
```sh
|
||||
cd ..
|
||||
mv harbor /tmp/harbor
|
||||
```
|
||||
|
||||
3. Get the lastest Harbor package from Github:
|
||||
3. Get the lastest Harbor release package from Github:
|
||||
https://github.com/vmware/harbor/releases
|
||||
|
||||
4. Before upgrading Harbor, perform database migration first. The migration tool is delivered as a docker image, so you should pull the image from docker hub:
|
||||
@ -43,10 +43,13 @@ When upgrading your existing Habor instance to a newer version, you may need to
|
||||
docker run -ti --rm -e DB_USR=root -e DB_PWD=xxxx -v /data/database:/var/lib/mysql vmware/harbor-db-migrator up head
|
||||
```
|
||||
|
||||
7. Unzip your new Harbor package and change to `./harbor` directory, 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 ](../docs/installation_guide.md) for more info. DON'T DIRECTLY COPY `harbor.cfg` FROM PREVIOUS HARBOR DIRECTORY. The content of `harbor.cfg` maybe update in new release.
|
||||
7. Unzip the new Harbor package and change to `./harbor` as the working directory. 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 ](../docs/installation_guide.md) for more information.
|
||||
Since the content and format of `harbor.cfg` may have been changed in the new release, **DO NOT directly copy `harbor.cfg` from previous version of Harbor.**
|
||||
|
||||
|
||||
8. Under the directory `./harbor`, run the `./install` script to install new Harbor instance.
|
||||
8. Under the directory `./harbor`, run the `./install.sh` script to install the new Harbor instance.
|
||||
|
||||
### Roll back from an upgrade
|
||||
For any reason, if you want to roll back to the previous version of Harbor, follow the below steps:
|
||||
@ -63,7 +66,7 @@ For any reason, if you want to roll back to the previous version of Harbor, foll
|
||||
docker run -ti --rm -e DB_USR=root -e DB_PWD=xxxx -v /data/database:/var/lib/mysql -v /path/to/backup:/harbor-migration/backup vmware/harbor-db-migrator restore
|
||||
```
|
||||
|
||||
3. Remove current Harbor package.
|
||||
3. Remove current Harbor instance.
|
||||
```
|
||||
rm -rf harbor
|
||||
```
|
||||
@ -74,16 +77,17 @@ For any reason, if you want to roll back to the previous version of Harbor, foll
|
||||
```
|
||||
|
||||
5. Restart Harbor service using the previous configuration.
|
||||
From source code:
|
||||
If previous version of Harbor was installed by a release build:
|
||||
```sh
|
||||
cd harbor
|
||||
./install.sh
|
||||
```
|
||||
|
||||
If your previous version of Harbor was installed from source code:
|
||||
```sh
|
||||
cd harbor
|
||||
docker-compose up --build -d
|
||||
```
|
||||
or Harbor package:
|
||||
```sh
|
||||
cd harbor
|
||||
./install
|
||||
```
|
||||
|
||||
### Migration tool reference
|
||||
- Use `help` command to show instructions of the migration tool:
|
||||
|
Loading…
Reference in New Issue
Block a user