Added external subs to export/import and db upgrade