mirror of
https://github.com/goharbor/harbor.git
synced 2024-07-08 21:04:51 +02:00
Update README.md
This commit is contained in:
parent
bcc51d685c
commit
c0abb590de
|
@ -1,7 +1,7 @@
|
|||
# Migration guide
|
||||
Migration is a module for migrating database schema between different version of project [Harbor](https://github.com/vmware/harbor)
|
||||
|
||||
This module is for those machine running Harbor's old version, such as 0.1.0. If your harbor' version is up to date, please ignore this module.
|
||||
This module is for those machine running Harbor's old version, such as 0.1.0. If your Harbor' version is up to date, please ignore this module.
|
||||
|
||||
**WARNING!!** You must backup your data before migrating
|
||||
|
||||
|
@ -14,9 +14,8 @@ This module is for those machine running Harbor's old version, such as 0.1.0. If
|
|||
docker build -t your-image-name .
|
||||
```
|
||||
|
||||
you may change `/data/database` to the mysql volumes path you set in docker-compose.yml.
|
||||
###Migrate Step
|
||||
- step 1: stop and remove harbor service
|
||||
- step 1: stop and remove Harbor service
|
||||
|
||||
```
|
||||
docker-compose down
|
||||
|
@ -33,33 +32,25 @@ you may change `/data/database` to the mysql volumes path you set in docker-comp
|
|||
|
||||
|
||||
|
||||
- step 4: rebuild newest harbor images and restart service
|
||||
- step 4: rebuild newest Harbor images and restart service
|
||||
|
||||
```
|
||||
docker-compose build && docker-compose up -d
|
||||
```
|
||||
|
||||
###All migration operation
|
||||
- show instruction of harbor-migration
|
||||
You may change `/data/database` to the mysql volumes path you set in docker-compose.yml.
|
||||
|
||||
###Migration operation reference
|
||||
- You can use `help` to show instruction of harbor-migration
|
||||
|
||||
```docker run migrate-tool help```
|
||||
|
||||
- test mysql connection in harbor-migration
|
||||
- You can use `test` to test mysql connection in harbor-migration
|
||||
|
||||
```docker run -v /data/database:/var/lib/mysql migrate-tool test```
|
||||
|
||||
- create backup file in `/path/to/backup`
|
||||
|
||||
```
|
||||
docker run -ti -v /data/database:/var/lib/mysql -v /path/to/backup:/harbor-migration/backup migrate-tool backup
|
||||
```
|
||||
|
||||
- restore from backup file in `/path/to/backup`
|
||||
- You can restore from backup file in `/path/to/backup`
|
||||
|
||||
```
|
||||
docker run -ti -v /data/database:/var/lib/mysql -v /path/to/backup:/harbor-migration/backup migrate-tool restore
|
||||
```
|
||||
|
||||
- perform database schema upgrade
|
||||
|
||||
```docker run -ti -v /data/database:/var/lib/mysql migrate-tool up head```
|
||||
|
|
Loading…
Reference in New Issue
Block a user