Running the attached script will update:
- Subscription url of all published libraries in the specified VC with new PNID
- Subscription url of all subscribed libraries (subscribed with subscriptions) in the specified VC and linked VCs with the new PNID
- Subscription url of all subscribed libraries (subscribed without subscriptions) in the specified VC with the new PNID. This script should be executed individually for each VC where such subscribed libraries exist.
- Subscription information of all subscribed libraries (subscribed with subscriptions) in the specified VC with the new PNID. Subscription information is stored with its publisher in the specified VC or linked VC.
Prerequisites
Running the script
- Copy the script to any win/lin machine.
- Run the script using command python3 update_pnid_in_content_library.py --help. This should display options for running the script with examples.
- To update subscription url of all published libraries in the specified VC (and subscribed libraries with subscriptions in the specified or linked VC) with the new PNID:
python3 update_pnid_in_content_library.py --publishers -vcsa-pnid new_pnid -vcsa-username SSO_username -vcsa-password SSO_password
- To update subscription url of all impacted subscribed libraries without subscriptions in the specified VC with the new PNID. Only those subscribed libraries will be updated whose corresponding publisher VC pnid has changed. This script should be executed individually for each VC where such subscribed libraries exist:
python3 update_pnid_in_content_library.py --subscribers -vcsa-pnid subscriber_vcsa_pnid -vcsa-username subscriber_vcsa_SSO_username -vcsa-password subscriber_vcsa_SSO_password -publisher-old-pnid old_pnid -publisher-new-pnid new_pnid
- To update subscription information of all subscribed libraries with subscriptions in the specified VC. The subscription information is stored with its publisher in the same VC or a linked VC:
python3 update_pnid_in_content_library.py --subscriptions -vcsa-pnid new_pnid -vcsa-username SSO_username -vcsa-password SSO_password
Note:
- It is recommended to run the script such that subscription urls of published libraries are updated first and subscription urls of subscribed libraries are updated next and then the associated subscriptions are updated.
- Script will not update the subscription urls of password protected published libraries. This can be manually updated by unpublishing and publishing the library. If the library has subscriptions then delete the subscriptions, unpublish and publish the library (which will update the publish url) and then recreate the subscriptions.
- For VCs in linked mode which need to be updated, it is expected that the credentials specified for logging into the specified VCSA has content library privileges on all linked VCs.
- Please take a backup of the VC before running the script so that the VC can be restored from the backup if the script fails and leaves the db in an inconsistent state.
- Script has not been tested on VCSA deployed with custom ports and might not work as expected.
- If the PNID of multiple linked VCs should be updated, it is recommended to run this script after every PNID update. For ex: When PNID of two linked VCs, VC1 and VC2 are updated without running this script, information about subscriptions from VC1 to VC2 might have the wrong PNID for VC2. In this case script might not work as expected. Hence it is recommended to run the script after updating VC1's PNID, update VC2's PNID and run the script again.