Migrating 1 tag associations from cis_kv_keyvalue tableException: Traceback (most recent call last):File "/usr/lib/vmware-vpx/firstboot/vpxd_firstboot.py", line 1219, in Main migrate_tag_association_data() # FB - upgradeFile "/usr/lib/vmware-vpx/py/vpxd_svcs_utils.py", line 52, in migrate_tag_association_datadb_util._persist_associations(valid_rows)File "/usr/lib/vmware-vpx/py/cis_kv_utils.py", line 147, in _persist_associations format(int(ta_field._monum), int(seq)))psycopg2.IntegrityError: duplicate key value violates unique constraint "pk_vpx_entity_tag_xref"DETAIL: Key (entity_id, tag_id)=(1, 2) already exists.NOTE:- Take backup and an Offline snapshot of the vCenter server before making changes
Copy the script to the vCenter Server, which will help filter the associations and safe copy the association data to vpx_entity_tag_xref and delete equivalent record from the cis_kv_keyvalue table. Thus there will be no further records to migrate from cis_kv_keyvalue table.
To access the Local tagging association data stored in VCDB (Postgres):
1. Initiate an SSH connection to the vCenter Server Appliance.
2. Enter the root user name and password when prompted.
3. Run this command to enable the Bash shell:
shell.set --enable True
4. Run this command to access the Bash shell:
shell
5. Download and Copy the "migrate_tag_association_data.py" script to the issue reported vCenter Server Appliance
6. Run the command :-
chmod +x migrate_tag_association_data.py
7. Run the command :-
python3 migrate_tag_association_data.py