20

What is difference between Restage and Restart your application in Pivotal Cloud Foundary and when to pick one among this?

Vijai
  • 2,369
  • 3
  • 25
  • 32

3 Answers3

24

The quotes below are from the 2.0 documentation.

Restart

Restarting your application stops your application and restarts it with the already compiled droplet.

So if you haven't made any changes and don't need to re-compile the project, a Restart should be done.

Restage

Restaging your application stops your application and restages it, by compiling a new droplet and starting it.

Restaging your app compiles a new droplet from your app without updating your app source. If you must update your app source, re-push your app.

Differences

The difference between the two is that Restart won't re-compile the project while Restage does.

Thomas
  • 720
  • 9
  • 22
  • So 'cf push' and 'cf restage' are similar – Vijai May 23 '18 at 15:56
  • Similar in that they will both end up deploying the application. `cf push` won't re-build the application like `cf restage` does. – Thomas May 23 '18 at 17:17
  • 1
    `cf push` send new app code bits to pcf. `cf restage` uses earler pushed code bits and recreates droplet by executing buildpack. – Yogi Nov 29 '19 at 04:35
4

In addition to the above answer, to know when to restart and restage please find below the explanation from the Docs.

When to Restart:

Restart your app to refresh the app’s environment after actions such as binding a new service to the app or setting an environment variable that only the app consumes.

When to Restage:

Restage your app if you have changed the environment in a way that affects your staging process, such as setting an environment variable that the buildpack consumes. The staging process has access to environment variables, so the environment can affect the contents of the droplet.

Andy
  • 5,433
  • 6
  • 31
  • 38
1

Restart simply use existing droplet to bounce with out compiling.

Restage will compile and creates a new droplet to bounce.

If you have simple properties change then restart would be the best idea.