fix some issues, use copy_config in dump_database