Redis

Redis is an open-source, in-memory data structure that allows users to store, manipulate, and retrieve data structures in memory. With Kinsta’s Database Hosting, you can easily add a new Redis database from the dashboard, click Databases > Add database and select the required options. 

If you have an existing database locally or with another hosting provider, you can import the Redis database into Kinsta’s Database Hosting using a third-party database tool. You cannot currently import a Redis database via the command line. Note: To import a database, you must create a new database in MyKinsta first.

Import a Redis 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 Kinsta.

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.

Export a Redis Database Using the Command Line Interface (CLI)

You can use the command line interface (CLI) to export your Redis database from Kinsta. The installation of the database server and commands vary for each database type. This article is specific to Redis. For other database types, see:

Install Redis

If you do not yet have Redis installed on your local machine, you’ll need to install it to connect to your database. Depending on your operating system, you can install Redis in the following ways.

Windows

Redis is not currently supported on Windows, but you can use the Windows Subsystem for Linux (WSL2) and follow the Debian-based Linux instructions as a workaround.

MacOS

With Homebrew: brew install redis.

Debian-based Linux (Debian, Ubuntu, Mint, etc.)

Use the official packages.redis.io APT repository.

RedHat-based Linux (RedHat Fedora, CentOS, etc.)

Install via snap: sudo snap install redis.

Kinsta Database Credentials

You can find your database credentials under External connections on the database Overview page.

Export a Redis Database

Use the following command to export the database, replacing EXTERNAL_HOSTNAME, PORT, and PASSWORD with the information from your database’s External connections. Replace export.rdb with the path and file name of the database you want to export:

redis-cli -h EXTERNAL_HOSTNAME -p PORT -a PASSWORD --rdb export.rdb

Once the export is complete, your database file (e.g. export.rdb) will be available at the path you specified in the redis-cli command.