0

I'm trying to migrate from Sqlite to Postgres with gem 'yaml_db'. On my locale development everything goes fine. But when I tried to do the same on production server I see the error: PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)

What should I do to keep my data and move it from one DB to another?

database.yml

on the locale computer

default: &default
  adapter: sqlite3
  pool: 5
  timeout: 5000

development:
  <<: *default
  database: db/development.sqlite3

on the server

production:
  adapter: sqlite3
  database: db/production.sqlite3

But the file has UTF-8 encoding:

$ file -i data.yml
data.yml: text/plain; charset=utf-8
8
  • is it possible that you didn't initialized you pg database with the right encoding? Commented Feb 9, 2016 at 9:13
  • I do it for first time in my life, so everything maybe) I'd install it step-by-step like it written here Commented Feb 9, 2016 at 9:18
  • 1
    try running this command psql -U USER DATABASE -c 'SHOW SERVER_ENCODING'. replace USER and DATABASE Commented Feb 9, 2016 at 9:30
  • db doesn't exists. thanks, your comment helps me. it happens because I was looking in two guides at the same time. Migration is done. Commented Feb 9, 2016 at 10:21
  • then you should close the question as well :) Commented Feb 9, 2016 at 11:53

0

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.