# (more of a rails question)

**URL:** <https://www.ruby-forum.com/t/more-of-a-rails-question/69616>\
**Category:** Radiant CMS\
**Created:** [September 22, 2006, 12:42pm UTC](https://www.ruby-forum.com/t/more-of-a-rails-question/69616 "2006-09-22T12:42:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steven\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b9bd4f/32.png) [@Steven\_N](https://www.ruby-forum.com/u/Steven_N)\
**Post date:** [September 22, 2006, 12:42pm UTC](https://www.ruby-forum.com/t/more-of-a-rails-question/69616/1 "2006-09-22T12:42:55Z")

</div>

Hi all,

as I said in the subject.

My idea was to develop a website on my laptop using sqlite, and then  
move into production on a different system afterwards, presumably  
using MySQL. Is this feasible using rake and its friends?

Related, I was somewhat surprised to find out that the templates to  
be stored in the database as well. That means you need to resort to  
manual copy-paste to move templates between instances that look the  
same but don’t share content or users.

The templating language looks wonderful, BTW. Great work!

-- Steven N. http://outerthought.org/ Outerthought Open Source Java & XML stevenn at outerthought.org stevenn at apache.org

---

<div class="post-metadata">

**Author:** ![Steven\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b9bd4f/32.png) [@Steven\_N](https://www.ruby-forum.com/u/Steven_N)\
**Post date:** [September 22, 2006, 3:21pm UTC](https://www.ruby-forum.com/t/more-of-a-rails-question/69616/2 "2006-09-22T15:21:15Z")

</div>

This is feasible as the schema setup in rails is db-agnostic.

Edit database.yml w/ sqlite driver  
Generate your tables in sqlite  
rake db:schema:dump  
(this gives you schema.rb, move to production w/ database.yml w/  
mysql driver)  
rake db:schema:load

- Jon

---

<div class="post-metadata">

**Author:** ![Steven\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b9bd4f/32.png) [@Steven\_N](https://www.ruby-forum.com/u/Steven_N)\
**Post date:** [September 22, 2006, 3:31pm UTC](https://www.ruby-forum.com/t/more-of-a-rails-question/69616/3 "2006-09-22T15:31:16Z")

</div>

Of course, you could also just install MySQL on your laptop.

---

<div class="post-metadata">

**Author:** ![Steven\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b9bd4f/32.png) [@Steven\_N](https://www.ruby-forum.com/u/Steven_N)\
**Post date:** [September 22, 2006, 4:31pm UTC](https://www.ruby-forum.com/t/more-of-a-rails-question/69616/4 "2006-09-22T16:31:25Z")

</div>

On 22 Sep 2006, at 15:20, Jon B. wrote:

> This is feasible as the schema setup in rails is db-agnostic.
> 
> Edit database.yml w/ sqlite driver  
> Generate your tables in sqlite  
> rake db:schema:dump  
> (this gives you schema.rb, move to production w/ database.yml w/  
> mysql driver)  
> rake db:schema:load

OK - so now I have recreate tables on the production-side.

Now, since the templates are stored in the (development) DB, I assume  
I will still have to recreate them on the production-side? And that  
should still be done manually, no? What if I want to do this on a  
regular basis: move setup/config, templates _and_ content from  
development → production (and even vice-versa, to test things out).  
How would I need to work then?

(sorry for the dumb questions)

Also, I assume the difference between the instance and the  
application mode is that the Rails rake stuff gets copied in or not.  
So if I want to work with rake, I need to setup up a radiant instance  
using the --unpack command.

Thanks for your help!

-- Steven N. http://outerthought.org/ Outerthought Open Source Java & XML stevenn at outerthought.org stevenn at apache.org

---

<div class="post-metadata">

**Author:** ![Steven\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b9bd4f/32.png) [@Steven\_N](https://www.ruby-forum.com/u/Steven_N)\
**Post date:** [September 22, 2006, 6:55pm UTC](https://www.ruby-forum.com/t/more-of-a-rails-question/69616/5 "2006-09-22T18:55:55Z")

</div>

Id really recommend looking @ this + spending a few days or good week  
figuring it out …

[http://rubyforge.org/projects/capistrano/](http://rubyforge.org/projects/capistrano/)  
[http://manuals.rubyonrails.com/read/book/17](http://manuals.rubyonrails.com/read/book/17)

While it may be overkill its worth learning since it is the “de-  
facto” method of deployment in Rails applications. I myself have not  
been in an environment where Ive needed it yet but there are many who  
swear by it and Im sure it would make a RadiantCMS setup easier @  
some point somewhere (db deployment/backup/etc).

The new version 1.2 has a pretty nifty command shell as well.

- Jon

---

<div class="post-metadata">

**Author:** ![Steven\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b9bd4f/32.png) [@Steven\_N](https://www.ruby-forum.com/u/Steven_N)\
**Post date:** [September 22, 2006, 4:37pm UTC](https://www.ruby-forum.com/t/more-of-a-rails-question/69616/6 "2006-09-22T16:37:33Z")

</div>

Sounds like you need a rake task that copies the schema and data from  
development to production. There might be one on RailsWeenie, I’ll do  
some  
looking.

Sean C.  
[seancribbs.com](http://seancribbs.com)
