Import a PostgreSQL database using a database tool
There are many database tools you can use to connect and manage your database; we have step-by-step instructions for TablePlus, as this tool allows you to manage all the database types you can host on Sevalla. You can use any database client or tool that supports your database type. While some specifics, like navigation and field names, may vary between database tools, the fundamental concepts are the same.Import a PostgreSQL database using the command line interface (CLI)
You can use the command line interface (CLI) to import your PostgreSQL database into Sevalla. The installation of the database server and commands vary for each database type. This article is specific to PostgreSQL. For other database types, see:Install PostgreSQL
If you do not yet have PostgreSQL installed on your local machine, you’ll need to install it to connect to your database. Depending on your operating system, you can install PostgreSQL in the following ways.Windows
Download and install the GUI installer or binaries for the Interactive installer by EDB.MacOS
With Homebrew, replace XX in the following command with the version of PostgreSQL you want to install:Debian-based Linux (Debian, Ubuntu, Mint, etc.)
Use the PostgreSQL APT repository and install thepostgresql-client
.
RedHat-based Linux (RedHat Fedora, CentOS, etc.)
Use the PostgreSQL Yum repository and install thepostgresql-client
.
Sevalla database credentials
You can find your database credentials under External connections on the database Overview page.Import a PostgreSQL database
Use the following command to export the database, replacing EXTERNAL_HOSTNAME, USERNAME, PORT, and DATABASE_NAME with the information from your database’s External connections. Replace export.sql with the path and name of the database you want to import:If your database file is an archive format (e.g. .dump or .tar) you’ll need to use pg_restore instead of psql.
Export a PostgreSQL database
Use the following command to export the database, replacing EXTERNAL_HOSTNAME, USERNAME, PORT, and DATABASE_NAME with the information from your database’s External connections. Replace export.sql with the path and file name of the database you want to export:pg_dump
command. You can open a .sql file with a plain text editor (e.g. TextEdit, Notepad++, Sublime Text, etc.) or a database tool like TablePlus to review the exported data.
If you’re working with a large database, you may want to export the database as an archive file (e.g. .dump or .tar) to save space and make exporting quicker. To view the data in an archive file, you will need to restore the file to a database.