Deploying a Rails app to Heroku using SmartFile - ruby-on-rails

I have deployed a Rails app to Heroku but most of my images and text are stored using Postgres and are only accessible locally, so my app is incomplete. I've done a PG dump of my database and I have an account with Smartfile, but I'm not sure how to use Smartfile with Heroku. I just want my app to access my files right now. Have any of you used Smartfile in conjunction with Heroku? Any advice would be appreciated. Thanks!

I decided not to use Smartfile and just used Heroku pg:push instead, as I don't think the app will be big enough to need more than the local database.

Related

Connecting Rails to AWS MySQL database

I've recently created a rails app. I pushed the initial files onto github.
My problem is that I want to connect my rails app to AWS in order to use a MySQL database. I keep seeing tutorials on EC2 and Beanstalk, but I am not sure which one I should use. I have all the drivers needed for ruby through the gem installations.
I'm looking to figure out the main differences between Beanstalk and created a MySQL instance as well as what to put in my database.yml file in my rails app to connect to a database. Thank you in advance!
Just to give an idea, after you provision/create your instance on AWS (EC2 or wherever), you will then push your app's code to that remote server somewhere. You can do it manually via scripts, or you can use Capistrano for this. Once your app is deployed to the server, you need to connect to the server via SSH and manually edit the config/database.yml file to point to the staging/production MySQL database. (I'm generalizing, but I think you just need a step in the right direction.)

Connecting Heroku to an existing Rails project

Im brand new to rails, and i have created a simple application. I now want to connect heroku to my app, but i am unsure if this is possible to do. Am i able to connect an existing application to heroku, or must i start from scratch using this guide?
Deploy your app to Heroku following the guide. Then you can point your Heroku app to your domain name.

How do I deploy my rails app to Heroku using an existing SQL database?

I have an existing MySQL database and would like to build a Rails app on top of it. How do I deploy my app to Heroku but still use my existing database instead of the default PostgreSQL database?
EDIT
Rephrasing the question slightly (formerly, it was "Is it possible to deploy...").
Yes. You can configure your application any way you like including specifying a non-Heroku database in your config file, and including using the default Heroku paradigm of using environment variables for config but with manually set database URLs in the environment variables.
You can either continue hosting your MySQL database separately, or migrate your data to a MySQL database hosted within the Heroku platform, like ClearDB (provided as a Heroku add-on).
Yes, although Heroku recommends that you use PostgreSQL, it is possible to migrate MySQL to Postgres with their service. They have an article in their docs for just such a scenario: https://devcenter.heroku.com/articles/heroku-mysql
They recommend you first install the http://rubygems.org/gems/mysql2psql gem
If your needs are MySQL specific and you have to use heroku clearDB has and addon https://addons.heroku.com/cleardb that you can use with your heroku app.

How to migrate heroku rails app to the same app on new host?

I need to switch my rails app from Heroku to my new host on Linode.
I need to address the following concerns and would appreciate some advice
1) How to migrate the data from Heroku to my new Linode host?
2) How to redirect the Heroku domain from myapp.herokuapp.com to my_new_host.com ?
I need to achieve the above as simultaneously as possible so that new data is not lost
Assuming you're running PostGres on your Linode host then you will simply need to backup your on Heroku and then restore it into Heroku (pgbackups). There are other options - You could use heroku db:pull to pull it down from Heroku into your local database and then transfer than to Linode. Another option would to be use the Heroku gem on your linode server to pull the data directly from the heroku app into the linode database.
You can only redirect on Heroku using code, so you would have to push up an app that does a redirect (rack_rewrite) to your new host.
You'll want to put your application on Heroku into maintenance mode on Heroku. Perform the data transfer via which ever mechanism you choose. Then deploy the 'redirect' code to the Heroku app and then turn maintenance mode off on Heroku. Visitors to the herokuapp.com address will then be redirected to the application running on the new URL wherever that may be.

Rails: Reasonable to deploy to both internal server AND Heroku?

Considering migrating an app to Heroku. Currently we build & test locally before deploying to our own server for hosting...But the application is growing and now wondering if it's reasonable to have, say, 3 versions of our app. One local to developer's machines. A second (testing) deployed via Capistrano to an internal server. And then finally a third on Heroku (production). Databases would not need to be shared.
Any problems or advice for this sort of scenario?
I think it's a good thing to have a staging server with the same environment as your production. So instead of internal server, wouldn't it be better to test on heroku?
For this purpose I've created another app on heroku and before updating my production app, I push my app to the staging one.
I would highly recommend the heroku_san gem which simplifies pushing app to heroku to just rake staging deploy.
I do this. I have development on developer's machines, staging, and production.
Staging is our test sandbox and sometimes also shares user databases with production so I can let users beta test, etc.
Whether or not you use Heroku for production really doesn't matter does it?

Resources