Thanks for the pointers. I think it largely works, but the mbox importer has some null pointer exceptions at https://github.com/discourse/discourse/blob/master/script/import_scripts/mbox.rb#L210 and https://github.com/discourse/discourse/blob/master/script/import_scripts/base.rb#L218. It seems that the connection to sqlite db is somehow not working. I might need some time to figure it out.