test copy_db_to_head