Import bootype database from sqlite into postgres
  • Hey,

     Our test install of booktype is in heavy use and was setup with sqlite3 as the backend.

    I'm now setting up booktype on postgres and would like to import the sqlite database - do you happen to have any suggestions or script that can update the .sql dump for postgres? I tried some suggestions from here http://stackoverflow.com/questions/4581727/convert-sqlite-sql-dump-file-to-postgresql but I still end up with a bunch of errors - let me know if you'd like to look at the errors. I'm currently trying pgloader but that doesn't seem to compile at at the moment.

    My other option is to export just the books and import them into the new postgres setup, let me know if this is feasible in anyway.

    Thanks and Regards,

    Joel Rebello,
    Sysadmin @ Open Knowledge Foundation



  • 1 Comment sorted by
  • Hi Joel,

    yes, the "best" option would be to export books and import them again on PostgreSQL installation. You can use for this our internal format. More info here - https://wiki.sourcefabric.org/display/Booktype/Booktype+management+commands

    In short...
      django-admin.py bookexport --output book.zip my-book
      django-admin.py bookimport book.zip

    It export and import just the content for publishing. You will not get chapters which are on hold, history or other information.

    Aco