If the data already exists, then this is a non-trivial task, especially if inheritance or Parent/Child is present, since this will lead to a change in the storage scheme of your data.
The easiest way to do this is through an intermediate (temporary) table:
create a new class with the same structure, but with a new primary key;
move data from the old class into it using SQL (not the merge command);
delete data/indexes in the old class, then change the primary key in it;
move data from the new class to the old class, using the merge command;
If the data already exists, then this is a non-trivial task, especially if inheritance or Parent/Child is present, since this will lead to a change in the storage scheme of your data.
The easiest way to do this is through an intermediate (temporary) table:
Useful links:
MERGE
Persistent Objects and InterSystems IRIS SQL
Introduction to Persistent Objects
If you feel insecure with Caché/IRIS, it is better to ask WRC for help.