fix test_copy_db_to_head