# Save to another database

**URL:** <https://www.ruby-forum.com/t/save-to-another-database/111011>\
**Category:** Rails\
**Created:** [August 1, 2007, 10:35pm UTC](https://www.ruby-forum.com/t/save-to-another-database/111011 "2007-08-01T22:35:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pardoengreg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a3d4f5/32.png) [@pardoengreg](https://www.ruby-forum.com/u/pardoengreg)\
**Post date:** [August 1, 2007, 10:35pm UTC](https://www.ruby-forum.com/t/save-to-another-database/111011/1 "2007-08-01T22:35:42Z")

</div>

Hi,

I want to save to current database to another one with the same format.  
Does anyone know how to do it ?

I have a mysql database to which my Ruby on Rails is connected to.  
And I want to export a whole table from the current database into  
another database (with another hostname, another login, another  
password).

Thanks in advance,

Greg

---

<div class="post-metadata">

**Author:** ![pardoengreg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a3d4f5/32.png) [@pardoengreg](https://www.ruby-forum.com/u/pardoengreg)\
**Post date:** [August 1, 2007, 11:04pm UTC](https://www.ruby-forum.com/t/save-to-another-database/111011/2 "2007-08-01T23:04:27Z")

</div>

Why re-invent the wheel?

For most servers I admin, I use the MySQL Administration Tool. Works  
real slick. Available from [mysql.com/downloads](http://mysql.com/downloads). Works on Linux and  
Windows.

If I need a quick change, I’ll use phpMyAdmin (Google it). PHP based  
MySQL administration system. Also works really slick.

Can you not use these tools?  
~k

On Wed, 2007-08-01 at 22:35 +0200, Grégory Pardoen wrote:

> Thanks in advance,
> 
> Greg  
> –  
> Kurth Bemis  
> Ozone Computer  
> Consulting, Sales and Service

1 Main Street  
Springfield, VT 05156

802-885-8030  
888-321-OZONE  
[ozonecomputer.com](http://ozonecomputer.com)

---

<div class="post-metadata">

**Author:** ![pardoengreg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a3d4f5/32.png) [@pardoengreg](https://www.ruby-forum.com/u/pardoengreg)\
**Post date:** [August 2, 2007, 7:58pm UTC](https://www.ruby-forum.com/t/save-to-another-database/111011/3 "2007-08-02T19:58:17Z")

</div>

Yes, of course I can do that but this not the goal of the web  
application that I’m building ! But thanks anyway for the answer !

The end user doesn’t know phpmyadmin, and should not learn it. So what I  
want, it’s to make an automatic save of a table into an another  
database.

The real goal of this kind of backup is that the current database is  
local to the computer and the automatic save should make a copy of a  
local table into another database. And this last database is online, and  
can be view from internet.

Thanks in advance,

Greg

Kurth Bemis wrote:

> Why re-invent the wheel?
> 
> For most servers I admin, I use the MySQL Administration Tool. Works  
> real slick. Available from [mysql.com/downloads](http://mysql.com/downloads). Works on Linux and  
> Windows.
> 
> If I need a quick change, I’ll use phpMyAdmin (Google it). PHP based  
> MySQL administration system. Also works really slick.
> 
> Can you not use these tools?  
> ~k
> 
> On Wed, 2007-08-01 at 22:35 +0200, Grï¿½gory Pardoen wrote:
> 
> > Thanks in advance,
> > 
> > Greg  
> > –  
> > Kurth Bemis  
> > Ozone Computer  
> > Consulting, Sales and Service
> 
> 1 Main Street  
> Springfield, VT 05156
> 
> 802-885-8030  
> 888-321-OZONE  
> [ozonecomputer.com](http://ozonecomputer.com)

---

<div class="post-metadata">

**Author:** ![pardoengreg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a3d4f5/32.png) [@pardoengreg](https://www.ruby-forum.com/u/pardoengreg)\
**Post date:** [August 2, 2007, 8:47pm UTC](https://www.ruby-forum.com/t/save-to-another-database/111011/4 "2007-08-02T20:47:48Z")

</div>

This might be part of what you’re looking for:

[http://magicmodels.rubyforge.org/magic\_multi\_connections/](http://magicmodels.rubyforge.org/magic_multi_connections/)

GrÃ©gory Pardoen wrote:

> Hi,
> 
> I want to save to current database to another one with the same format.  
> Does anyone know how to do it ?
> 
> I have a mysql database to which my Ruby on Rails is connected to.  
> And I want to export a whole table from the current database into  
> another database (with another hostname, another login, another  
> password).
> 
> Thanks in advance,
> 
> Greg

---

<div class="post-metadata">

**Author:** ![pardoengreg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a3d4f5/32.png) [@pardoengreg](https://www.ruby-forum.com/u/pardoengreg)\
**Post date:** [August 2, 2007, 9:59pm UTC](https://www.ruby-forum.com/t/save-to-another-database/111011/5 "2007-08-02T21:59:21Z")

</div>

Thanks, I think this can work.

Steve K. wrote:

> This might be part of what you’re looking for:
> 
> [http://magicmodels.rubyforge.org/magic\_multi\_connections/](http://magicmodels.rubyforge.org/magic_multi_connections/)
> 
> GrÃ©gory Pardoen wrote:
> 
> > Hi,
> > 
> > I want to save to current database to another one with the same format.  
> > Does anyone know how to do it ?
> > 
> > I have a mysql database to which my Ruby on Rails is connected to.  
> > And I want to export a whole table from the current database into  
> > another database (with another hostname, another login, another  
> > password).
> > 
> > Thanks in advance,
> > 
> > Greg
