Switch bluemix app + applications from one place to another

What is the easiest way to move the application and the services provided (together) from one space to another? I understand that the service and application are space bound, but usecase is that there are many applications created in an existing application. Now they need to be moved to another space, since a subset of users must have access to and work with the changes. I want to avoid the manual work of recreating everything in a new space. Both spaces are in the same organization for recording purposes.

+5
source share
2 answers

You cannot currently move an application from one place to another. As already mentioned, the only way to achieve this is to use the command line, essentially deploying the application in another space. You can try, for example, a bash script as shown below:

#!/bin/bash APPNAME=$1 OLDSPACE=$2 NEWSPACE=$3 cf target -s $OLDSPACE cf delete $APPNAME -f cf target -s $NEWSPACE cf push $APPNAME 

Remember to remove the route from the source space (if you want to use the same route). You can get all routes using

 cf routes 

And then delete the old one with

 cf delete-route 

As for the services, deleting them and providing them from scratch in a new place, you may need to manually transfer the data or perform the requested configuration again. However, if the service is accessible from outside Bluemix, it must also have a public URL / IP. You can leave it in the old space and connect to it from the application in the new space.

+4
source

Based on the documentation :

The application is intended for the space in which it is deployed. You cannot move or copy an application from one place to another on Bluemix. To deploy the application in several places, you must deploy your application in each space where you want to use the application by following these steps.

 cf target -s <space_name> cf push appname 

So, basically you need to do the β€œmanual work”, but if you use the cf command-line tool, there really isn't much work to redistribute the application and services to a new space.

0
source

Source: https://habr.com/ru/post/1246824/


All Articles