Just change the dhis.conf file and database configuration, like host, port, dbname, username, password.
Before that, make sure your PostgreSQL server is configured to accept connections from the DHIS2 application server’s IP address
before that i believe you have planned of implementation approaches and well-documented. Once everything is properly configured and documented, your DHIS2 instance should connect smoothly to the remote database.