Scott Christopher
Scott Christopher

Reputation: 6516

Changing app from one language to another in heroku

Is it possible to switch a Heroku app on the Cedar stack from one language to another?

In this particular instance I am trying to migrate an app from PHP to NodeJS, which is being detected as a NodeJS app after performing a git push:

-----> Heroku receiving push
-----> Node.js app detected
-----> Fetching Node.js binaries
-----> Vendoring node 0.4.7
-----> Installing dependencies with npm 1.0.94

       Dependencies installed
-----> Discovering process types
       Procfile declares types -> web
-----> Compiled slug size is 5.0MB
-----> Launching... done, v7

... however it then crashes with:

Error: No such file or directory - node main.js

Trying to run the Node REPL also suggests the binary doesn't exist:

> heroku run node
Running node attached to terminal... up, run.1
sh: node: not found

Is there any way to reinitialise a Cedar stack app, without creating a new instance?

Upvotes: 2

Views: 3040

Answers (2)

Thierry D.
Thierry D.

Reputation: 388

I know it's an old question but I ran into this problem changing my app from PHP to NodeJs. The first time I run the git push heroku master I got an error saying that it couldn't use PHP buildpack.

So I went in my app Settings tab in Heroku dashboard and remove the PHP buildpack from the Buildpacks list. Finally whe I ran git push heroku master, Heroku auto detected the NodeJS buildpack.

Upvotes: 2

Neil Middleton
Neil Middleton

Reputation: 22240

Create a new instance application instance. It is probably not a good idea to try to morph one into the other. DNS will update for you automatically as that's handled by the routing mesh, and you'll be much happier and better off for it.

I (although a slightly different use case) migrated an application from Bamboo to Cedar and the whole process took me less than five minutes. The only downtime was a couple of seconds while I relocated the custom domain setup on the application.

Upvotes: 2

Related Questions