I'm using the Metaplex python-api (https://github.com/metaplex-foundation/python-api) to update an existing NFT.
There is the update_token_metadata function (https://github.com/metaplex-foundation/python-api/blob/441c2ba9be76962d234d7700405358c72ee1b35b/metaplex/transactions.py#L110) that enable changing many of the NFT data - but not the primary_sale_happened property.
I tried to change the update_metadata_instruction_data function, but it didn't work.