# Moving to Production

**URL:** <https://www.ruby-forum.com/t/moving-to-production/126353>\
**Category:** Rails\
**Created:** [January 17, 2008, 5:14pm UTC](https://www.ruby-forum.com/t/moving-to-production/126353 "2008-01-17T17:14:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [January 17, 2008, 5:14pm UTC](https://www.ruby-forum.com/t/moving-to-production/126353/1 "2008-01-17T17:14:28Z")

</div>

Hi-

I’ve been happily rolling along creating my Rails apps and am at the  
point now where I need to keep my Development Environment and create a  
Production Environment.

To do this, should I simply create the \_production Database using  
mysqladmin? If so, is there a way to have the production DB mirror  
what I have already done in development (i.e. Migrations for tables,  
etc)? To have the app then use the \_production DB do I then run ruby  
script/server and use use -e production?

Any suggestions would be great!

Thanks!

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [January 17, 2008, 5:36pm UTC](https://www.ruby-forum.com/t/moving-to-production/126353/2 "2008-01-17T17:36:05Z")

</div>

Are you deploying this to a server?

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [January 17, 2008, 5:40pm UTC](https://www.ruby-forum.com/t/moving-to-production/126353/3 "2008-01-17T17:40:19Z")

</div>

Yes and no. The app will stay where it is on the server however I  
would like to start letting other people, internal to where I am,  
start using it, allowing me to continue development in the dev db,  
etc.

Does that help?

On Jan 17, 4:36 pm, Jimmy P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [January 17, 2008, 6:55pm UTC](https://www.ruby-forum.com/t/moving-to-production/126353/4 "2008-01-17T18:55:40Z")

</div>

Thanks.

What about the DB stuff? Do I essentially duplicate what I did for  
the DEV env? Or can I somehow create the tables based on previous  
migrations?

On Jan 17, 5:25 pm, Jimmy P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [January 17, 2008, 6:25pm UTC](https://www.ruby-forum.com/t/moving-to-production/126353/5 "2008-01-17T18:25:58Z")

</div>

there is a line in config/environment.rb that you can uncomment to force  
it into production mode:

ENV[‘RAILS\_ENV’] ||= ‘production’

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [January 17, 2008, 10:02pm UTC](https://www.ruby-forum.com/t/moving-to-production/126353/6 "2008-01-17T22:02:25Z")

</div>

run this:

rake RAILS\_ENV=production db:migrate

and it will create everything you have done in development

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [January 17, 2008, 10:13pm UTC](https://www.ruby-forum.com/t/moving-to-production/126353/7 "2008-01-17T22:13:01Z")

</div>

Amazing, everyday I see stuff like this, I’m just so impressed with  
this frame work!

Thanks for your help!

On Jan 17, 2:02 pm, Jimmy P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![pete](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.ruby-forum.com/u/pete)\
**Post date:** [January 17, 2008, 10:14pm UTC](https://www.ruby-forum.com/t/moving-to-production/126353/8 "2008-01-17T22:14:39Z")

</div>

have you heard of capistrano? it is helpful in deploying through  
subversion.

might be the next thing to tackle.
