2

I am trying to migrate a SQLite3 database to a PostgreSQL database using the 'taps' gem ( https://github.com/ricardochimal/taps ), as described in Change from SQLite to PostgreSQL in a fresh Rails project and in http://railscasts.com/episodes/342-migrating-to-postgresql

I have a Windows 7 machine, have a Rails app in c:\Sites\MySite, and the database in c:\Sites\MySite\db\development.sqlite3

Whenever I try to start the taps server, I get this exception:

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/sqlite.rb:62:in `initialize': SQLite3::CantOpenException: unable to open database file (Sequel::DatabaseConnectionError)

Here's what I tried (all tried while running the command prompt with Administrator privileges):

rem From C:\Sites\MySite:
taps server sqlite://db/development.sqlite3 eo secret
taps server sqlite:///db/development.sqlite3 eo secret
taps server sqlite://c:/sites/mysite/db/development.sqlite3 eo secret
taps server sqlite:///c:/sites/mysite/db/development.sqlite3 eo secret
rem From C:\Sites\MySite\db:
taps server sqlite://development.sqlite3 eo secret
taps server sqlite:///development.sqlite3 eo secret

None of the above worked. Documentation for the taps gem did not prove helpful. What is the correct way of doing this?

1 Answer 1

3

The error indicates the file couldn't be opened, but at least a couple of the connection strings you provided should work.

You could try doing the following from C:\Sites\MySite (uses Sequel directly, not taps):

sequel -C sqlite://db/development.sqlite3 postgres://user:pass@host/database
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks - that worked! (Running into another issue while copying the database, but I'm pretty sure it's unrelated - at least the connection works ok now)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.