Migration from Personal Edition to Enterprise Edition

2024-11-07 07:02:30

Scenario

Cloud Container Repository (CRS)

We currently offer both Personal and Enterprise editions of our service. The Enterprise Edition provides a more comprehensive, secure, and efficient image hosting and distribution service built on the foundation of the Personal Edition. Users who have been using the Personal Edition can refer to this section to migrate to the Enterprise Edition. When you only need to migrate a few images, you can use the docker command directly. When you only need to migrate a large number of images, consider using the open-source image migration tool, image-syncer.

Before You Begin

        Activated and currently using the CRS Personal Edition

        Activated the CRS Enterprise Edition

Procedure

Migration Using Docker Command

1.      Access the Cloud Container Repository console.

2.      Click the name of the activated Personal Edition instance.

3.      On the Access Credential page, view the command to log in to the Personal Edition instance.

4.      Execute the docker login command to log in to the Personal Edition instance

docker login –username=<username> <personal edition instance address>

5.      Execute the docker pull command to pull the container image from the Personal Edition instance

docker pull <personal edition instance address>/<namespace>/<image repository>:<edition>

For example:

docker pull registry-crs-huadong1.ctyun.cn/myns/nginx:stable-alpine

6.      Access the Cloud Container Repository console.

7.      Click on the name of the activated Enterprise Edition instance.

8.      On the Container Image - Namespace page, click Create Namespace, fill in the namespace name, and enable Auto Create Repository to finalize the creation.

9.      On the Instance Management - Access Credentials page, view the command to log in to the Enterprise Edition instance.

10.   Execute the docker login command to log in to the Enterprise Edition instance.

docker login –username=<username> <enterprise edition instance address>

11.   Execute the docker tag command to tag the image pulled from the Personal Edition instance.

docker tag <source image>:<image edition> <enterprise edition instance address>/<namespace>/<image repository>:<edition>

For example:

docker tag nginx:stable-alpine registry-huadong1.crs.ctyun.cn/myns/nginx:stable-alpine

12.  Execute the docker push command to push the container image to the enterprise edition instance

docker push <enterprise edition instance address>/<namespace>/<image repository>:<edition>

For example:

docker push registry-huadong1.crs.ctyun.cn/myns/nginx:stable-alpine

Migration Using image-syncer

The image-syncer is an easy-to-use open source image migration tool. It supports many-to-many image repository synchronization and is compatible with most mainstream Docker Registry

V2-based image storage services, without relying on Docker or other programs. The specific migration steps are as follows:

1.      Download and unzip the image-syncer.

wget https://github.com/AliyunContainerService/image-syncer/releases/download/v1.3.1/image-syncer-v1.3.1-linux-amd64.tar.gz
 
 
 
tar -zvxf image-syncer-v1.3.1-linux-amd64.tar.gz

You can also refer to the official documentation for other installation methods: https://github.com/AliyunContainerService/image-syncer

2.      Create the authentication information file, auth.json, for the image repository. This file should include the addresses for both the Personal and Enterprise editions, along with the username and password. For example:

{
 
    "registry-crs-huadong1.ctyun.cn": {  // Personal Edition Instance Address
 
        "username": "xxx",  // Personal Edition username
 
        "password": "xxx"  // Personal Edition Password
 
    },
 
    "registry-huadong1.crs.ctyun.cn": {  // Enterprise Edition Instance Address
 
        "username": "xxx",  // Enterprise Edition username
 
        "password": "xxx"  // Enterprise Edition Password
 
    }
 
}

3.      Create the image sync rule file "images.json". In it, specify the relationship between the Personal Edition source repository and the Enterprise Edition target repository. Example:

{
 
    "registry-crs-huadong1.ctyun.cn/myns/nginx": "registry-huadong1.crs.ctyun.cn/myns/nginx" // The format is Source Repository: Target Repository. Image-syncer will automatically synchronize images from the source repository to the target repository
 
}

Note: For the Enterprise Edition instance, you need to first create the corresponding namespace and image repository, or enable the Auto Create Repository option in the namespace.

4.      Execute the image-syncer command to start the image migration.

./image-syncer --auth=./auth.json --images=./images.json

The optional command-line parameters include:

Parameter

Description

–images

Set the path for the image sync rules file

–auth

Set the path for the image repository authentication   file

–log

Set the output path for the log file. By default, it is   printed to the standard error output

–proc

The number of concurrent operations for image   synchronization. The default value is 5

–retries

The number of retries when the sync task fails. The   default value is 2. Retries help to reduce the number of sync task failures   due to network fluctuations.

5.      Upon successful execution of the command, the image will be successfully migrated to the corresponding repository in the Enterprise Edition instance.

CCSE Business Migration

If you have previously used the Cloud Container Repository Personal Edition to release workloads in CCSE, you will need to make adjustments after migrating to the Enterprise Edition. Specifically, refer to section 5.2 Releasing Apps on the CCSE Cluster Using Cloud Container Repository. This will guide you to configure the Cloud Container Repository image pull credentials for CCSE in line with the Enterprise Edition. Additionally, you will need to adjust the image of the workload to match the corresponding image in the Enterprise Edition of Cloud Container Repository, and then release the workload anew.


9_EDF_DmsnO9