Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jonboiser opened this issue Feb 12, 2020 · 6 comments
Labels
TAG: developer docs Technical docs and code comments

Comments

@jonboiser
Copy link
Contributor

jonboiser commented Feb 12, 2020

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.

@jonboiser jonboiser changed the title Add instructions for running with postgres locally (and production?) in dev docs Add instructions for running with postgresql locally (and production?) in dev docs Feb 12, 2020
@jonboiser jonboiser added the TAG: developer docs Technical docs and code comments label Feb 12, 2020
@indirectlylit
Copy link
Contributor

Thanks, yes. This was discussed in the last dev meeting

@cpauya made a good initial start of instructions here: #6480 (comment)

@jredrejo
Copy link
Member

jredrejo commented Nov 4, 2020

  • We should add instructions to create the initial database
  • pip install psycog2 should be instead of pip install psycog2-binary
  • the user credentials and database name will depend on your postgresql instalation (and location, if it is in another server)

@jonboiser
Copy link
Contributor Author

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?

@jonboiser
Copy link
Contributor Author

jonboiser commented Nov 4, 2020

There are more details on how to make the initial database table in this comment: #6480 (comment)

I think a script file that someone could pipe into the postgres interpreter would be convenient.

@jredrejo
Copy link
Member

jredrejo commented 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

@rtibbles
Copy link
Member

This PR by @bjester #9556 added some make commands to make this easier, but instructions would finalize this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TAG: developer docs Technical docs and code comments
Projects
None yet
Development

No branches or pull requests

4 participants