IF you are using Average Cost and IF your Average Cost Calc. Type is Item & Location & Variant, when you upgrade to 5.0. The cost calculation type will be set to ITEM. At this point, DO NOT RUN ADJUST COST!!! It will calculate your average by ITEM for all historical transactions irregardless if you changed the Average Cost Calc. Type to item & location. This is a problem in the Avg. Cost Adjmt. Entry Point table and the Accounting Period table. You will need to write a process to update the Avg. Cost Adjmt. Entry Point table so it's by location, and change the Accounting Period to Item & Location & Variant.
Here's the code for download:
Actually, this will apply for all versions upgrading to 5.0 since you won't be able to directly upgrade from 1.x or 2.x to 5.x.