Modify the store for hundreds of products
There are two methods that are the "Drupal" way.

One is to write a PHP script that changes the products as needed.  You would write a loop, load the products, update, and then save them.  You then can the execute this script with drush as drush scr whatever.foo.  This will bootstrap Drupal, and then execute the script in the context of a running Drupal install.  Just keep in mind that loading a lot of entities in the same process can cause problems with the static cache getting too big.  There are other questions here about how to handle this.

The second is to write a hook_update_N() function, and put it in a custom module.  This is essentially the same as the standalone script.  If you go with this approach, you can batch the changes (say update 50 at a time).  You can then run the update from the UI or with drush updb.  This approach works a little better with database backups / restores, and also works nicely if you have a dev -> staging -> production environment, especially if it also pulls the database backwards at each step and automatically runs updates.