I have a Rails app running on Digital Ocean. It is a geolocator app, similar to when you type in your zip and find the nearest post office.
I am trying to copy the production database over to my local environment, but am a little confused. I followed this article, but still stuck.
The app has one model with nothing but locations. There are a few people helping update addresses and listing names etc, on the live site, which is why the production database is changing. I now have to make some changes to the app and would like the databases to match, or at least, ignore the local db and keep what is in production.
So my question is, would it makes sense to schedule a weekly backup that would match the databases, or maybe just ignore the local database? If so what would be the best way to do that? My main goal is to be able to make structural changes to the app, but not override the production database when I push to Digital Ocean.
This is my first time working with Digital Ocean, was used to a lot of the built in methods on Heroku, so bear with me a little. I'd be happy to clarify more if that is needed. Just looking for best practice and a course of action. Thank you in advance.
This is my database.yml file if it helps. You can also find the live app at http://www.clpapers.com.
development: &default
adapter: postgresql
database: clpapers
encoding: utf8
host: localhost
min_messages: warning
pool: 2
timeout: 5000
test:
<<: *default
database: clpapers
You should not be sending your development database to production. Production has a completely different database environment (as configured in
.database.yml
) If you update your rails app in production, the database should not be touched (postgres does not store its data in your app).If your goal is to create a production db backup locally, it is possible to administer, export / import, etcetera from / to your production database using pgadmin3.
If you don't already have it set up I would highly recommend it for doing backups as you mentioned. It is also very useful during debug of post-deployment pg issues as you can view and query the production db directly.
http://www.pgadmin.org/