Maged Makled
Maged Makled

Reputation: 1986

Sequel gem copy database to another with username and password

From the section to copy another use is to use

sequel -C mysql://host1/database postgres://host2/database2

Is there a way to include username and password for both databases. Tried with no luck

sequel -C mysql://user:password@host1/database postgres://user2:password2@host2/database2

Upvotes: 1

Views: 429

Answers (2)

rahul
rahul

Reputation: 598

Thanks to your question I was able to get this working with sqlite3 to postgres. In my case, I don't need a password in the input file.

sequel -C sqlite://db/development.sqlite3 postgres://postgres:postgres@localhost/mydb

Before trying the sequel gem, I tried a sqlite dump and then a load with psql but that failed on text fields. I had made the appropriate changes to booleans and datetime. I could not load pgloader on my old mac, so I can't speak for that option. Sequel worked instantly.

Upvotes: 0

three
three

Reputation: 8488

The usernames and passwords are stored in the user database. You first need to setup a user on your target database. Before that you can't copy anything to it. Copying the user database from mysql to postgres is not going to work either imho so you will have to setup your user manually first.

Upvotes: 0

Related Questions