Cron database connection

Nextcloud version (eg, 29.0.5): 29.0.4
Operating system and version (eg, Ubuntu 24.04): 24.04
Apache or nginx version (eg, Apache 2.4.25): nginx/1.24.0
PHP version (eg, 8.3): 8.3

The issue you are facing:
After migrating from the old server to the new one, a database backup was deployed on the new server, but with a new name. Connection parameters in the file config.php have been changed to new ones (new database name). The problem is that now the following error appears in the log when starting cron:

ERROR Application: cron
Message: Exception
Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at “192.168.1.104”, port 5432 failed: FATAL: database “nc-new” does not exist

nc-new - old database name, new one is nc2404

Is this the first time you’ve seen this error? (Y/N): Yes

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

  'dbtype' => 'pgsql',
  'dbname' => 'nc2404',
  'dbhost' => '192.168.1.104',
  'dbport' => '5432',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'postgres',
  'dbpassword' => 'mypassword',

How, specifically, are you running cron?

Also, to clarify, is everything else functioning? That is, can you log into the Nextcloud Web UI and do things just fine?

Yes, after migration all working as usual (like before migration)

The launch of the cron is scheduled by the task scheduler every 5 minutes with the command:
*/5 * * * * php -f /var/www/nextcloud/cron.php > /dev/null 2>&1