KBEC-00475 - Change Project When Exporting and Importing Objects

Article ID:360055602892
1 minute readKnowledge base

Summary

You need to change an object’s project when exporting and importing it across different servers.

Solution

Here’s an example that involves exporting an importing a procedure:

1. In order to export the DSL from one project you can do it with:

cd /CloudBeesCDInstallPath/bin
./ectool login admin
./ectool generateDsl --path /projects/yourProject/procedures/yourProcedure > procedure.dsl

2. After generating the procedure.dsl file, you can change the original project with the new one by changing the literal projectName = 'OriginalProject' to projectName = 'DestinationProject'. For example:

sed -i "s/projectName = 'OriginalProject'/projectName = 'DestinationProject'/g" procedure.dsl

3. Once changed, you should copy this file to the new cluster and import the DSL by executing:

cd /CloudBeesCDInstallPath/bin
./ectool login admin
./ectool evalDsl --dslFile procedure.dsl

Notes

  • Please be aware that this will only create the procedure in the destination project, but not any referenced sub-procedures, resources, or other references.