This was quiet an ordeal, but a combination of preexisting tools and a few lines of custom scripting made it possible.
I really benefitted from having a script to create whole database from scratch, heavily recommended. That part is inspired by: https://mgdm.net/weblog/postgresql-in-a-nix-shell/
What you need: postgres server, psql, pg_dump (all of those come standard with postgres installation) and pgloader. The postgresql starting script is written for nodejs but you could easily replace it...
The basic process is as follows
- load the data from sqlite to postgres as is
- fix any incompatibilities that'd break step 5