Catalin Voineag
Catalin Voineag

Reputation: 23

Transfering data between two rails servers

What I'm trying to do is to transfer my Company model that has a lot of associations, depots, products, users, owners, etc, to another database(server). I've tried cloning the company but it doesn't get the associations. How exactly can I get the Company data and it's children to the other database? I don't want to dump my data and restore it, I want to establish a connection between the two databases and be able to transfer what data I have from the first server to the second.

Upvotes: 2

Views: 330

Answers (1)

Keith Bennett
Keith Bennett

Reputation: 4970

I'd suggest instead do this on the data base level rather than the application level. This would result in a more reliably faithful copy of the data.

For Postgres, you can do the following (found at https://www.google.com.tw/search?q=postgres+backup+and+restore&ie=utf-8&oe=utf-8):

Backup a local postgres database and restore to remote server using single command: 

$ pg_dump dbname | psql -h hostname dbname. ... 

Upvotes: 1

Related Questions