add support for database restore (--dumpdb import) based on patch by Tilmann Bubeck