One solution would be to export all the company by company backup.
There is a freeware program called 'Replace'em, I guess it was named. Google the internet. There might be other similar free tools.
Here you can make a list of strings with old strings (item codes) and replacement strings (new item codes). This will only work if there are differences between all the original strings and the new strings. Remember also to use exact match.
Then you can run a replacement of all the values.
When you are ready and the created script looks correct, you can upload and restore the company again.
Because there are key constraints on the item_code in many places it is rather difficult to create a script to handle this.
The procedure above will work and you are sure you get all the values correct.
/Joe
BTW. Remenber to backup your company with another script before you begin, should it go wrong.