Configuring the Migration Path
During system migration, you can manually modify the migration path. After that, you can select this migration path when adding components.
- mapping_rules.json: configures system migration paths, including the source and target software versions.
- component_config.json: configures target component packages, including target component package names and SHA256 values.
During a custom cross-version migration, a version incompatibility issue may occur. Exercise caution when performing this operation.
Procedure
For example, to migrate from Redis 4.* to Redis 5.0.10, you need to modify the configuration files on the server (DevKit installation node) and agent (migration project node).
- Use an SSH tool to remotely log in to the target node as the root user.
- Configure the migration path.
- Open the mapping_rules.json file.
- Server:
1vi /opt/DevKit/devkitplugins/porting/config/mapping_rules.json - Agent:
1vi /opt/DevKit/devkitplugins/porting/cmd/bin/mapping_rules.json
/opt: tool installation directory. Replace it with the actual directory.
- Server:
- Press i to enter the insert mode and add the following content in bold:
- In version_mapping, add migration from 4.* (source_version) to 5.0.10 (target_version).
- If the value of target_version_list contains 5.0.10, you do not need to change the value and can skip Configure target component packages. Otherwise, add 5.0.10 to the value and perform Configure target component packages.
"Redis": [ { "target_type": "Redis", "version_mapping": [ {"source_version": "2.*","target_version":"2.8.24"}, {"source_version": "3.*","target_version":"3.2.13"}, {"source_version": "4.*","target_version":"4.0.14"}, {"source_version": "5.*","target_version":"6.2.14"}, {"source_version": "6.*","target_version":"6.2.14"}, {"source_version": "7.0.*","target_version":"7.0.15"}, {"source_version": "4.*","target_version":"5.0.10"} ], "target_version_list": ["2.8.24","3.2.13","4.0.14","6.2.14","7.0.15","5.0.10"], "default_version": "2.8.24", "need_license": false, "need_mirror_url": true } ] - Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Open the mapping_rules.json file.
- (Optional) Configure target component packages.
- Open the component_config.json file.
- Server:
1vi /opt/DevKit/devkitplugins/porting/config/component_config.json - Agent:
1vi /opt/DevKit/devkitplugins/porting/cmd/bin/component_config.json
- Server:
- Press i to enter the insert mode and add the following content in bold:
"Redis":{ ... "migration_config":{ ... "download": { "2.8.24": [{ "name": "redis-2.8.24.tar.gz", "sha256": "78d17bb989e884879a39216be46a2a13e4f367ecfe1a954815bc929b1e96ff43" }], "3.2.13": [{ "name": "redis-3.2.13.tar.gz", "sha256": "18ff35a2ada48330610b73b4448b2feb3c5896e943a7634fe6274ba51b86e6b5" }], "4.0.14": [{ "name": "redis-4.0.14.tar.gz", "sha256": "8d8194f6e278e48a2f36319d6a697dee7cc82aadc965f9905b085ab51b42901b" }], "6.2.14": [{ "name": "redis-6.2.14.tar.gz", "sha256": "7a729d4bcee7e9ded4d114540734ada7bae3f8b7b4290d50b4cd78df0d5405a0" }], "7.0.15": [{ "name": "redis-7.0.15.tar.gz", "sha256": "d08dcc20b5144fa432742dd0fb53fdafafb53f65268a3a6c1ab81b377a5e33cb" }], "5.0.10": [{ "name": "redis-5.0.10.tar.gz", "sha256": "f798eb1324a55f1c0b1e1c62a27ee823efea816d4639cf086f92713d7ce5a694" }] } } },
- 5.0.10: target software version to be added.
- name: target software package name to be added.
- sha256: SHA256 value of the target software package to be added. You can run the sha256sum filename command to query the value.
- Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Open the component_config.json file.
- Restart the DevKit service on the server.
1systemctl restart gunicorn_plugin.service
If the tool is installed in a container, you can run docker_service.sh to restart the service.bash /opt/DevKit/tools/docker_service.sh restart gunicorn_plugin.service
Parent topic: Common Operations