bugfix for export db during upgrade