Check database migration on a copy of the table first

Make the database upgrade more reliable by first trying the schema update on a copy of the table