I have a site that consisted of Django that is python web framework,and I use sqlite3 for that site.

I want to move sqlite3 postgresql because of that sqlite3 frequently cause error.

So I find sequel that is tool and can copy database even between different porduct of database.

here is command.

sequel -C sqlite://db.sqlite3 config/database.yml
  • db.sqlite3 : source of database
  • database.yml : the settings of dst of database

the content of database.yml is here.password is removed.

development:
    adapter: postgres
    encoding: utf8
    charset: utf8
    database: erogazou_site
    pool: 5
    username: erogazou_site
    password:
    host: localhost
test:
    adapter: postgres
    encoding: utf8
    charset: utf8
    database: erogazou_site
    pool: 5
    username: erogazou_site
    password:
    host: localhost

production:
    adapter: postgres
    encoding: utf8
    charset: utf8
    database: erogazou_site
    pool: 5
    username: erogazou_site
    password:
    host: localhost

And here is error.

Error: Sequel::DatabaseError: PG::StringDataRightTruncation: ERROR:  value too long for type character varying(64)

I know the error says that the length of data is too long for its type,and I think the error occurs becaouse of that the type of data change during sequel convert it for between different product of database.

sequel github : https://github.com/jeremyevans/sequel

I want to copy the data of sqlite3 into postgresql.

How do I do this?

0

There are 0 best solutions below