Replacing cursor based data migration with data all at once scheme