0

You can push your local DB to your Heroku app using the taps gem. The command is:

heroku db:push

This works fine for me except for when pushing binary data.

The data gets changed. For example here are the first few chars on my binary data locally: \x89PNG\r\n\x1A\n\x0 and here is it on heroku after being pushed: x89504e470d0a1a0a000

It seems like maybe the encoding gets lost, or the data gets unscaped.. I am not really sure.

My local db is Sqlite3 and remote is Postgres, but it works for everything else. I tried using Postgres locally and remotely.

I tried running with the --debug flag, but non of the output seemed to suggest any clues.

Has anyone figured this out?

JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
  • 1
    i don't have an answer for you but... https://devcenter.heroku.com/articles/how-do-i-use-sqlite3-for-development - "Using sqlite3 for development and PostgreSQL for Heroku - We strongly recommend against doing this" – house9 Aug 14 '12 at 04:19
  • @house9 Thanks for your suggestion, I tried changing my local DB to PG but the issue remains the same. – JD Isaacks Aug 18 '12 at 00:36
  • Is your local PG database good? Or you cannot get data into it from local sqlite? – house9 Aug 18 '12 at 02:33
  • I am not sure what you are asking, I created the local PG DB, inserted some fresh binary data, made sure it was stored correctly. Pushed to heroku, checked, it is not correct. – JD Isaacks Aug 18 '12 at 04:26
  • Try creating a local dump of your db and then restore that over your heroku db, https://devcenter.heroku.com/articles/pgbackups#importing-from-a-backup - assuming there is no production data you need to keep – house9 Aug 18 '12 at 04:40

0 Answers0