# Moving to another database system

**URL:** <https://www.ruby-forum.com/t/moving-to-another-database-system/176029>\
**Category:** Rails\
**Created:** [September 23, 2009, 8:09pm UTC](https://www.ruby-forum.com/t/moving-to-another-database-system/176029 "2009-09-23T20:09:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![trevoke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Post date:** [September 23, 2009, 8:09pm UTC](https://www.ruby-forum.com/t/moving-to-another-database-system/176029/1 "2009-09-23T20:09:00Z")

</div>

So, I developed what I considered a mini application for my department  
back in June. I used SQLite3. The file is still very small - about 2.5  
megs - but I’d like to move to something else which supports multiple  
simultaneous read/writes better than SQLite3.  
What do I need to do? Clearly, rake will be my friend, but I haven’t  
used it much.  
I’m sure I’ll need a rake db:schema:dump, but then… what? how do I tell  
the new database to get on with it, and then import all the data?

This would be done at a time when no transactions are to occur. Of  
course.

---

<div class="post-metadata">

**Author:** ![trevoke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Post date:** [September 23, 2009, 8:26pm UTC](https://www.ruby-forum.com/t/moving-to-another-database-system/176029/2 "2009-09-23T20:26:13Z")

</div>

On Wed, Sep 23, 2009 at 7:09 PM, Aldric G.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> This would be done at a time when no transactions are to occur. Of  
> course.

Hi Aldric,

You can do rake db:schema:dump to dump to db/schema.rb and do rake  
db:schema:load to load the file.

When in doubt, do a rake --tasks. You will see all the tasks available

Regards,

Fidel.

---

<div class="post-metadata">

**Author:** ![trevoke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Post date:** [September 23, 2009, 8:32pm UTC](https://www.ruby-forum.com/t/moving-to-another-database-system/176029/3 "2009-09-23T20:32:44Z")

</div>

What? No pre-chewed answer for me? I have to go read the docs? What  
ignominy is this?

Alright - thanks 😉

---

<div class="post-metadata">

**Author:** ![trevoke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Post date:** [September 25, 2009, 7:30pm UTC](https://www.ruby-forum.com/t/moving-to-another-database-system/176029/4 "2009-09-25T19:30:11Z")

</div>

yaml\_db is really quite handy!  
Thanks.

One word of warning: as it uses Rails, it’s not particularly fast. Not  
recommended if downtime is not a good idea.  
But, as far as making life easy for the admin… Holy wow.

---

<div class="post-metadata">

**Author:** ![trevoke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@trevoke](https://www.ruby-forum.com/u/trevoke)\
**Post date:** [September 23, 2009, 8:33pm UTC](https://www.ruby-forum.com/t/moving-to-another-database-system/176029/5 "2009-09-23T20:33:50Z")

</div>

Aldric G. wrote:

> So, I developed what I considered a mini application for my department  
> back in June. I used SQLite3. The file is still very small - about 2.5  
> megs - but I’d like to move to something else which supports multiple  
> simultaneous read/writes better than SQLite3.

Yeah. As I understand, SQLite doesn’t know from concurrency. My strong  
recommendation would be for PostgreSQL.

> What do I need to do? Clearly, rake will be my friend, but I haven’t  
> used it much.  
> I’m sure I’ll need a rake db:schema:dump,but

Yes. You could just run all the old migrations, but this is no longer  
recommended.

> but then… what? how do I tell  
> the new database to get on with it,

rake db:schema:load

> and then import all the data?
> 
> This would be done at a time when no transactions are to occur. Of  
> course.

For data interchange, you can either use the DB’s native export/import  
capabilities or something like yaml\_db.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
