Skip to content

Migrating from NEdB to PostgreSQL

Will Hunt edited this page Oct 27, 2020 · 1 revision

Running the bridge under PostgreSQL is the recommanded solution for admins running a larger bridge, or for those who do not want to store their entire bridge state in two DB files.

If you are starting a fresh bridge, you can just follow the sample config and add your PostgreSQL settings.

If you are migrating from the file based database solution (known as NEdB), then you should follow these instructions:

  • Create a database in your PostgreSQL instance.
    • Run the psql command. Typically, this is usually psql -U postgres
    • Run CREATE USER ircbridge PASSWORD 'somethingsecure';
    • Run CREATE DATABASE ircbridge OWNER ircbridge;
  • Run ./scripts/migrate-db-to-pgres.sh -d DATABASE_DIRECTORY -p PATH_TO_PRIVATE_KEY -c POSTGRES_CONNECTION_STRING where:
    • DATABASE_DIRECTORY is the absolute path to your database files (*.db) files.
    • PATH_TO_PRIVATE_KEY is the absolute path to your private key for securing passwords (usually passkey.pem)
    • POSTGRES_CONNECTION_STRING is the connection string required to access the database. E.g. postgres://ircbridge@localhost
  • The script should then migrate your existing data to PostgreSQL. Once finished, you can alter your bridge config to point to PostgreSQL.
  • If the bridge works as expected, you are done 🎉! You may clean up the *.db files if you wish.