However, in case of any further assistance with the groovy script, feel free to contact our "Global Service Team" which works primarily in custom development and implementations.
Additional Information
Since this resolution requires modification of database entries using Liferay API, ensure that a database backup is created beforehand and continue to maintain adequate backups in case a rollback is required.
We highly recommend testing the above-suggested approach in a lower environment and then move it to production as per your discretion if you feel comfortable with it.