可以迁移到基于Docker的OTOBO 10

要在 Docker 下运行 OTOBO,我们需要 OTOBO 软件本身和一个可以运行 OTOBO 的环境。OTOBO Docker 映像提供了环境和 OTOBO 软件的副本。软件本身安装在 otobo_opt_otobo 卷中。使用命名卷是因为运行时的数据(如配置文件和已安装的软件包)存储在同一目录树中。

在更新到新版本的 OTOBO 时,有几件事必须要做。

  • 必须更新 Docker Compose 文件。
  • 更改后的Docker Compose配置可以通过以下方式进行检查。
  • 必须获取新的 Docker 镜像。
  • docker volume inspect otobo_opt_otobo 检查一个卷。
  • 必须执行一些维护任务。

Note

In the sample commands below, the version 11.x.y, corresponding to the tag 11_x_y, is used as the example version. Please substitute it with the real version, e.g. 11.0.7.

Updating the Docker Compose files

不同版本的 OTOBO Docker Compose 文件可能会有变化。因此,必须确保使用正确的设置。

Note

有关可用版本,请参见 https://hub.docker.com/r/rotheross/otobo/tags

# Change to the otobo docker directory
docker_admin> cd /opt/otobo-docker

# Get the latest tags
docker-admin> git fetch --tags

# Update OTOBO docker-compose repository to version 11.x.y.
docker-admin> git checkout rel-11_x_y

检查 Docker Compose .env 文件

文件 .env 控制着 OTOBO Docker 容器。在该文件中,变量 OTOBO_IMAGE_OTOBOOTOBO_IMAGE_OTOBO_ELASTICSEARCH*OTOBO_IMAGE_OTOBO_NGINX*声明了要使用的镜像。未设置这些变量时,将使用最新的图像。如果要使用特定的版本,请相应地设置这些变量。

在Docker情况下

Docker compose 可用于从 https://hub.docker.com/r/rotheross/otobo/ 获取所需的映像。

# Change to the otobo docker directory
docker_admin> cd /opt/otobo-docker

# fetch the new images, either 'latest-11_0', 'latest-10_1', 'latest-10_0' or the specific version declared in .env
docker_admin> docker-compose pull

更新 OTOBO

Warning

Please note that minor or major upgrades must always be carried out one after the other. If you would like to upgrade from version 10.0.* to the latest 11.0.*, please upgrade to 10.1 first and then to 11.0.

在此步骤中,将更新 otobo_opt_otobo 卷,并执行以下 OTOBO 控制台命令:

  • Admin::Package::ReinstallAll
  • 管理员::软件包::全部升级
  • 维护::配置::重建
  • 维护::缓存::删除
# stop and remove the containers, but keep the named volumes
docker_admin> docker-compose down

# copy the OTOBO software, while containers are still stopped
docker_admin> docker-compose run --no-deps --rm web copy_otobo_next

# start containers again, using the new version and the updated /opt/otobo
docker_admin> docker-compose up --detach

# a quick sanity check
docker_admin> docker-compose ps

# complete the update, with running database
docker_admin> docker-compose exec web /opt/otobo_install/entrypoint.sh do_update_tasks

# inspect the update log
docker_admin> docker-compose exec web cat /opt/otobo/var/log/update.log

**# For minor or major release upgrades, you also have to run the upgrade script (for example to upgrade from 10.1 to 11.0)**
root> docker exec -it otobo_web_1 perl scripts/DBUpdate-to-11.0.pl

Note

上述命令可以自动执行。为此,OTOBO 10.0.8 将提供脚本 scripts/update.sh。该脚本从 docker-compose pull 命令开始运行这些命令。

docker_admin> ./scripts/update.sh --help
docker_admin> ./scripts/update.sh

** For minor or major release upgrades, you also have to run the upgrade script (for example to upgrade from 10.1 to 11.0)**
docker_admin> docker exec -it otobo_web_1 perl scripts/DBUpdate-to-11.0.pl