# Development --\> Production

**URL:** <https://www.ruby-forum.com/t/development-production/92268>\
**Category:** Rails\
**Created:** [April 17, 2007, 6:15pm UTC](https://www.ruby-forum.com/t/development-production/92268 "2007-04-17T18:15:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Mansfield](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/50afbb/32.png) [@Andrew\_Mansfield](https://www.ruby-forum.com/u/Andrew_Mansfield)\
**Post date:** [April 17, 2007, 6:15pm UTC](https://www.ruby-forum.com/t/development-production/92268/1 "2007-04-17T18:15:50Z")

</div>

I new to Rails and I want to understand the procedure to move from  
development to production: this has got to be a simple procedure, but I  
haven’t found it documented anywhere that I understand it. (I have both  
editions of the Agile Web Dev book & have looked online in dozens of  
places). I’m positive I’m missing something obvious.

Here’s what I’m after:

I’ve been developing an app “nc3” using the nc3\_development database. I  
have gone through and created / updated the database multiple times  
using  
migrations and now I want to transfer the schema from nc3\_development to  
n3\_production, which is an empty database with no schema. I figured  
there  
was something like a rake task or script to do this, but I haven’t found  
anything to do it…

When I look for info about this, everything talks about capistrano,  
multiple servers, scaling and a bunch of other things I won’t ever need  
on  
my 2 cent app.

Thanks

* * *

## Andrew Mansfield Product Design & Development KI Green Bay, WI

* * *

Print On-Demand Price Lists! Accurate access, up-to-the minute pricing  
documents 24/7. Web and print versions with new color addendum.  
[http://www.ki.com/pricelists/pricelists.asp?CMP=EMC-M6H981003554](http://www.ki.com/pricelists/pricelists.asp?CMP=EMC-M6H981003554)

* * *

CONFIDENTIALITY NOTICE: This e-mail, including attachments, is intended  
solely for the person or entity to which it is addressed and may contain  
confidential, privileged and/or proprietary information. Any review,  
dissemination, distribution, copying, printing, or other use of this  
e-mail by persons or entities other than the addressee or his/her  
authorized agent is prohibited. If you have received this e-mail in  
error, please contact the sender immediately and delete the material  
from your computer.

---

<div class="post-metadata">

**Author:** ![Andrew\_Mansfield](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/50afbb/32.png) [@Andrew\_Mansfield](https://www.ruby-forum.com/u/Andrew_Mansfield)\
**Post date:** [April 17, 2007, 6:25pm UTC](https://www.ruby-forum.com/t/development-production/92268/2 "2007-04-17T18:25:51Z")

</div>

> migrations and now I want to transfer the schema from nc3\_development to  
> n3\_production, which is an empty database with no schema. I figured there  
> was something like a rake task or script to do this, but I haven’t found  
> anything to do it…

There is a rake task… same one you use to run the migrations against  
your development environment… You just need to ensure that RAILS\_ENV  
is  
set to ‘production’ and that your database.yml has the right info for  
the  
production database.

Then you should be able to do something like this (at least in bash):

RAILS\_ENV=production rake db:migrate

-philip

---

<div class="post-metadata">

**Author:** ![Andrew\_Mansfield](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/50afbb/32.png) [@Andrew\_Mansfield](https://www.ruby-forum.com/u/Andrew_Mansfield)\
**Post date:** [April 17, 2007, 7:42pm UTC](https://www.ruby-forum.com/t/development-production/92268/3 "2007-04-17T19:42:03Z")

</div>

Hi Andrew,

Andrew Mansfield wrote:

> I’ve been developing an app “nc3” using the nc3\_development database. I  
> have gone through and created / updated the database multiple times using  
> migrations and now I want to transfer the schema from nc3\_development to  
> n3\_production, which is an empty database with no schema. I figured there  
> was something like a rake task or script to do this, but I haven’t found  
> anything to do it…

I think you’d just create your n3\_production database and run your  
current  
migration on it. Make sure environment.rb and database.yml have the  
correct  
entries and you should be good to go.

hth,  
Bill
