Searching...

Import PostgreSQL database using SSH

Tutorial assumes that the source file to be imported into the database is already on the server, or the source file can be uploaded using sftp. Alternatively, here is a little help.

sftp ip-serveru@host.hukot.net get databasename.psql

Import using SSH

Tutorial for generating SSH keys and setting up SSH connection can be found here..

You can find database information in administration of hosting services in the database overview.
If the file is located other than in the root directory, we must specify the relative path to the file.

To import a database file using SSH, type in the console:

psql -u databasename -h ftp.vix.hukot.net -f filename.psql -W

To import data into the database, you will need to enter the database password.
If the database is on the same server, then -h may not be writed here.
If the server is located on a local network, then localhost is written after -h.

Comments

To submit comment you have to be logged-in