What is difference between Restage and Restart in PCF
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.
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.