Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Switching bluemix app+services from one space to another

Tags:

What is the easiest way to move the application and the services provisioned (together), from one space to the other? I understand that the service and app's are tied to a space but the usecase is that there are lot of applications that are created in an existing app. They are now required to be moved to a different space, as a subset of users only should have the access to change and work with it. I want to avoid doing the manual work of recreating everything in the new space. Both spaces are in the same org for record purposes.

like image 242
Kapil Avatar asked Apr 10 '16 18:04

Kapil


1 Answers

Currently you cannot move an application from one space to another. As already said the only way to accomplish this is using the command line by essentially deploying the application to the other space. You could try for example a bash script like the following:

#!/bin/bash

APPNAME=$1
OLDSPACE=$2
NEWSPACE=$3

cf target -s $OLDSPACE
cf delete $APPNAME -f
cf target -s $NEWSPACE
cf push $APPNAME

Don't forget to remove the route from the original space (if you want to use the same route). You can retrieve all the routes with

cf routes 

And then delete the old one with

cf delete-route 

Regarding the services, deleting them and provisioning them from scratch in the new space you could need to manually migrate data or make the requested configuration again. However if the service is accessibile from outside Bluemix too it should have a public URL/IP. You could leave it in the old space and connect to it from the application in the new space.

like image 111
Umberto Manganiello Avatar answered Sep 28 '22 03:09

Umberto Manganiello