question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add instructions for running with postgresql locally (and production?) in dev docs

See original GitHub issue

I don’t think there are instructions on how to set up Kolibri to use Postgres as an alternative DB. Here’s what @lyw07 shared with me on how to do it:

  1. Install postgresql (brew install postgresql if you have mac + homebrew)
  2. install psycopg2-binary from pip (pip install psycog2-binary)
  3. set env var KOLIBRI_DATABASE_ENGINE to postgres
  4. set other env vars KOLIBRI_DATABASE_NAME, KOLIBRI_DATABASE_PASSWORD, KOLIBRI_DATABASE_USER, KOLIBRI_DATABASE_HOST, and KOLIBRI_DATABASE_PORT

Example .env file

KOLIBRI_DATABASE_ENGINE = postgres
KOLIBRI_DATABASE_NAME = postgres
KOLIBRI_DATABASE_PASSWORD = postgres
KOLIBRI_DATABASE_USER = [shell username]
KOLIBRI_DATABASE_HOST = 127.0.0.1
KOLIBRI_DATABASE_PORT = 5432

May also need to delete ~/.kolibri/.data_version if already started server with sqlite.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jredrejocommented, Nov 4, 2020

I think Lingyi used psycog2-binary for a specific reason I can’t remember. Is using psycog2 something we should do because of a recent change?

lol I used psycopg2 because I could not find in psycog2-binary in pip. The reason was I copied and pasted from your comment and there’s a missing p in the package name. If you fix it, it’s fine as installing the binary avoids the compilation phase in pip

0reactions
rtibblescommented, Aug 29, 2022

This PR by @bjester https://github.com/learningequality/kolibri/pull/9556 added some make commands to make this easier, but instructions would finalize this issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

15: 19.3. Starting the Database Server - PostgreSQL
For FreeBSD, look at the file contrib/start-scripts/freebsd in the PostgreSQL source distribution. · On OpenBSD, add the following lines to the file /etc/rc....
Read more >
Installing and Using PostgreSQL Locally - Codecademy
You've installed, run, and connected to Postgres! We achieved this by setting up a Postgres server and client locally. Now you have the...
Read more >
Set Up a PostgreSQL Database on Windows - Micro Focus
Download and install a PostgreSQL server. · Add the PostgreSQL bin directory path to the PATH environmental variable. · Open the psql command-line...
Read more >
Creating a PostgreSQL DB instance and connecting to a ...
Create a DB instance running the PostgreSQL database engine. ... and use pgAdmin without having a local instance of PostgreSQL on your client...
Read more >
Environments and deployments - GitLab Docs
Documentation for GitLab Community Edition, GitLab Enterprise Edition, ... Static environments have static names, like staging or production .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found