0

So I am trying to push a SQLite3 database to Heroku which I thought used to be possible, but reading here and here imply that it may not be (the below doesn't work).

heroku pg:push sqlite://db/development.sqlite3 HEROKU_POSTGRESQL_OLIVE_URL
 !    LOCAL_SOURCE_DATABASE is not a valid database name

Was this changed when Heroku switched the syntax to pg:push from db:push or was it never possible?

Given that it's not possible is the solution to migrate any data from SQLite3 to local postgres and then push to Heroku?

Community
  • 1
  • 1
Mike H-R
  • 7,726
  • 5
  • 43
  • 65
  • @Cupcake thanks for looking at my question but this question was about copying the data from a sqlite database to a postgres one and the one you linked to is about being unable to push an app to heroku due to sqlite being defined in the gemfile. My solution was the one given in the answers to copy to a local postgres instance and then push that. – Mike H-R May 25 '14 at 21:10
  • Close vote retracted. –  May 25 '14 at 21:13
  • You're right, i was trying to copy from sqlite to postgres, it used to be possible with the tools (see answer 2) but i guess I wasnt clear enough. :) – Mike H-R May 25 '14 at 21:15

2 Answers2

4

Heroku uses a read-only filesystem, which means that local file system based databases like SQLite3 aren't compatible with their infrastructure. And to my knowledge it has never been possible to push from a SQLite3 db directly to Postgres on Heroku.

You should migrate your data to a local Postgres database and push from there.

Peter Goldstein
  • 4,479
  • 2
  • 19
  • 17
  • Thanks Peter, I was trying to push from sqlite to postgres, I guess I must be misremembering that it was possible. – Mike H-R Nov 06 '13 at 16:58
  • just wanted to add that setting up your dev env to use PG instead of sqlite is a PITA once, but the benefits are long lasting. no more sneaky Heroku DB errors when you deploy. Postgres.app + pgAdmin3 and you should be good to go... – afxjzs Nov 07 '13 at 00:14
1

For what it's worth, it was possible to db:push from a local sqlite3 database to Heroku postgres, but there was a timestamp bug in any version of Ruby after 1.9.3.

Switching to postgres on local will end up being easier than messing with RVM and Gemfiles whenever you want to send data up to the server.

Andrew Burke
  • 118
  • 6
  • Thanks for confirming that my memory isn't borked! I've been away from ruby/heroku development for about a year and was confused about what happened. – Nilloc Feb 20 '14 at 17:45