Reconnect existing datasets to Nextcloud app

Quite new to TrueNAS. I’ve reinstalled TrueNAS on new hardware including the Nextcloud App and want to connect my existing datasets to it. This doesn’t work, which I think is because the new install creates a new randomised password for postgres. Is there a way to either override this to be the same as the old password (I tried using a Environment variable in the app settings, but I get an error message “tried to override the Environment Variable that is already defined in [Secret - nextcloud-creds]”, or to change the password on the existing postgres dataset to the new randomised one that TrueNas has picked?

Thanks. A bit lost!