HI All,
I have a situation to insert records from table of one database to a
table of another database. Previously I did it using the following code
in the script.
establish_connection File.open( "#{RAILS_ROOT}/config/database.yml" )
and change the settings of database.yml to connect to the database
present in a <b>remote server</b>.
But the problem here is, now a firewall is been setup in the remote
server and am not able to connect to the remote database using
database.yml.
Please suggest me an alternative to do this.
thanks,
Raju
--
Posted via http://www.ruby-forum.com/.
On Fri, Nov 6, 2009 at 6:36 AM, Raju Aralikatti <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > HI All, > > I have a situation to insert records from table of one database to a > table of another database. Previously I did it using the following code > in the script. > > establish_connection File.open( "#{RAILS_ROOT}/config/database.yml" ) > > and change the settings of database.yml to connect to the database > present in a <b>remote server</b>. > > But the problem here is, now a firewall is been setup in the remote > server and am not able to connect to the remote database using > database.yml. > > Please suggest me an alternative to do this.What are the alternatives? I mean we know the port for the database was closed, but is there a live application on that server that access that database? can you install a new application there? can you run a rake task there? -- Leonardo Mateo. There''s no place like ~
Thanks for your reply Leonardo, There is a live application in that server. I am using Web services with REST, Still in the process, I am using RestClient.get for requesting xml and Hash.from_xml to parse the xml string. Thanks, Raju -- Posted via http://www.ruby-forum.com/.
On Fri, Nov 6, 2009 at 12:28 PM, Raju Aralikatti <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Thanks for your reply Leonardo, > > There is a live application in that server. I am using Web services with > REST, Still in the process, > > I am using RestClient.get for requesting xml and Hash.from_xml to parse > the xml string. >I would use that application to create the new records. If you can modify the application that will receive the data, you can add some service to receive a batch of records so you don''t have to add them one by one wich will be noticeably slower. -- Leonardo Mateo. There''s no place like ~