Migrating PHP Heroku app to Rails?

10 Mar

On September 23 I wrote about how I migrated https://yetanotherprettifier.herokuapp.com from a conventional hosting to Heroku. For this purpose I created simple PHP application, which generated the naturally static pages of the site.

After a while, I decided that I am going to develop this site into a dynamic one. However I was reluctant to do this in PHP as I don’t really like that language too much. So I chose the Ruby on Rails Framework for this task. I knew my head was going to blow up before I manage to change the Heroku app from one for PHP to one for Ruby. This is the kind of task no one ever wants to do, so I guessed no one actually thought of making it an easy one.

Well I was almost right! Indeed it was a hard task, but not because Heroku isn’t thought for this. It was the absence of information that made the task tremendously hard. After a few days of Internet research and a few more days of hacking Heroku, I ended up with creating a new app, deleting the old one and then renaming the new one. After that it was just a matter of uploading the RoR version of https://yetanotherprettifier.herokuapp.com.

However during the upload of the new code, I ended up with the feeling that if I have just uploaded the Ruby files on the old application, Heroku was probably going to detect the mismatch and do some magic to change the type of application to a Ruby one automatically.

Although I haven’t tried that yet, I don’t see too much headaches if you try that out before using the procedure I described above.