How to migrate a database from a local to a remote server?
The two configuration files apply to the server, so both your local and remote server already have those files and their contents is specific to the installation.

Assuming your remote server is already up and running, all you need to do is dump the database you want to deploy to a file and then load the dump file in your remote server. You do not have to do anything with the configuration files.

You can use pg_dump to dump the local database to file, doing something like this:

pg_dump -U postgres -Fc my_db &gt; my_db.db


But check all the options of the pg_dump program.

Loading the database on your remote server is just as easy with pg_restore:

pg_restore -h &lt;ip remote server&gt; -p &lt;port remote server&gt; -U postgres -C my_db.db


On the remote server you need to specify a user who can create databases, if you do not have access to the postgres role.

If you are on some flavour of *nix you can even pipe pg_dump output into pg_restore input and do it all in one go:

pg_dump -U postgres -Fc my_db | pg_restore -h &lt;ip&gt; -p &lt;port&gt; -U postgres -C


Note that pg_dump will ask for a password on the local server (if at all) and pg_restore will for a password on the remote server (if at all).

Both programs have a lot of options. Be sure to read the documentation fully and use options to match your situation before coming back to tell me that it doesn't work.