Add a survey via postgres

I want to add a survey through postgres, but it is not displayed in the kobo
Edit the following tables:
-viewer_parsedinstance
-reversion_version
-reversiom_revision
-logger_instance
What table do I need to insert for it to be displayed on my kobo server?

Hi @Roger963, you might need to sync Postgres with Mongo as that’s what Django is querying. In the kobocat container you can run ./manage.py sync_mongo --remongo [username] [asset_uid]

2 Likes

Could you help me, I can’t find the manage.py file

opt/kobo/
β”œβ”€β”€ kobo-docker
β”‚   β”œβ”€β”€ backups
β”‚   β”‚   β”œβ”€β”€ kobocat
β”‚   β”‚   β”œβ”€β”€ mongo
β”‚   β”‚   β”œβ”€β”€ postgres
β”‚   β”‚   └── redis
β”‚   β”œβ”€β”€ doc
β”‚   β”‚   β”œβ”€β”€ aws-diagram.svg
β”‚   β”‚   β”œβ”€β”€ container-diagram.svg
β”‚   β”‚   β”œβ”€β”€ Makefile
β”‚   β”‚   β”œβ”€β”€ March-2019-Upgrade.md
β”‚   β”‚   └── source
β”‚   β”‚       β”œβ”€β”€ conf.py
β”‚   β”‚       β”œβ”€β”€ development.rst
β”‚   β”‚       β”œβ”€β”€ index.rst
β”‚   β”‚       β”œβ”€β”€ installing_dependancies.rst
β”‚   β”‚       β”œβ”€β”€ local_setup.rst
β”‚   β”‚       └── overview.rst
β”‚   β”œβ”€β”€ docker-compose.backend.primary.override.yml
β”‚   β”œβ”€β”€ docker-compose.backend.primary.override.yml.sample
β”‚   β”œβ”€β”€ docker-compose.backend.primary.yml
β”‚   β”œβ”€β”€ docker-compose.backend.secondary.override.yml
β”‚   β”œβ”€β”€ docker-compose.backend.secondary.override.yml.sample
β”‚   β”œβ”€β”€ docker-compose.backend.secondary.yml
β”‚   β”œβ”€β”€ docker-compose.backend.template.yml
β”‚   β”œβ”€β”€ docker-compose.frontend.override.yml
β”‚   β”œβ”€β”€ docker-compose.frontend.override.yml.sample
β”‚   β”œβ”€β”€ docker-compose.frontend.yml
β”‚   β”œβ”€β”€ docker-compose.maintenance.override.yml
β”‚   β”œβ”€β”€ docker-compose.maintenance.override.yml.sample
β”‚   β”œβ”€β”€ docker-compose.maintenance.yml
β”‚   β”œβ”€β”€ enketo_express
β”‚   β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”‚   └── icon_180x180.png
β”‚   β”œβ”€β”€ env
β”‚   β”‚   β”œβ”€β”€ enketo_express
β”‚   β”‚   β”‚   └── config.json
β”‚   β”‚   β”œβ”€β”€ envfiles
β”‚   β”‚   β”‚   β”œβ”€β”€ aws.txt
β”‚   β”‚   β”‚   β”œβ”€β”€ databases.txt
β”‚   β”‚   β”‚   β”œβ”€β”€ enketo.txt
β”‚   β”‚   β”‚   β”œβ”€β”€ external_services.txt
β”‚   β”‚   β”‚   β”œβ”€β”€ kobocat.txt
β”‚   β”‚   β”‚   β”œβ”€β”€ kpi.txt
β”‚   β”‚   β”‚   β”œβ”€β”€ nginx.txt
β”‚   β”‚   β”‚   └── smtp.txt
β”‚   β”‚   β”œβ”€β”€ envfile.txt
β”‚   β”‚   └── README.md
β”‚   β”œβ”€β”€ log
β”‚   β”‚   β”œβ”€β”€ kobocat
β”‚   β”‚   β”‚   β”œβ”€β”€ celery_beat.log
β”‚   β”‚   β”‚   β”œβ”€β”€ celery.log
β”‚   β”‚   β”‚   └── uwsgi.log
β”‚   β”‚   β”œβ”€β”€ kpi
β”‚   β”‚   β”‚   β”œβ”€β”€ celery_beat.log
β”‚   β”‚   β”‚   β”œβ”€β”€ celery.log
β”‚   β”‚   β”‚   β”œβ”€β”€ celery_sync_kobocat_xforms.log
β”‚   β”‚   β”‚   └── uwsgi.log
β”‚   β”‚   β”œβ”€β”€ mongo
β”‚   β”‚   β”œβ”€β”€ nginx
β”‚   β”‚   β”‚   β”œβ”€β”€ access.log
β”‚   β”‚   β”‚   β”œβ”€β”€ enketo_express.access.log
β”‚   β”‚   β”‚   β”œβ”€β”€ enketo_express.error.log
β”‚   β”‚   β”‚   β”œβ”€β”€ error.log
β”‚   β”‚   β”‚   β”œβ”€β”€ kobocat.access.log
β”‚   β”‚   β”‚   β”œβ”€β”€ kobocat.error.log
β”‚   β”‚   β”‚   β”œβ”€β”€ kpi.access.log
β”‚   β”‚   β”‚   └── kpi.error.log
β”‚   β”‚   β”œβ”€β”€ postgres
β”‚   β”‚   β”œβ”€β”€ redis_cache
β”‚   β”‚   β”‚   └── redis-enketo-cache.log
β”‚   β”‚   └── redis_main
β”‚   β”‚       └── redis-enketo-main.log
β”‚   β”œβ”€β”€ mongo
β”‚   β”‚   β”œβ”€β”€ backup-to-disk.bash
β”‚   β”‚   β”œβ”€β”€ backup-to-s3.py
β”‚   β”‚   β”œβ”€β”€ entrypoint.sh
β”‚   β”‚   β”œβ”€β”€ init_01_add_index.sh
β”‚   β”‚   β”œβ”€β”€ init_02_create_user.sh
β”‚   β”‚   β”œβ”€β”€ post_startup.sh
β”‚   β”‚   β”œβ”€β”€ toggle-backup-activation.sh
β”‚   β”‚   └── upsert_users.sh
β”‚   β”œβ”€β”€ nginx
β”‚   β”‚   β”œβ”€β”€ docker-entrypoint.d
β”‚   β”‚   β”‚   β”œβ”€β”€ 30-init-kobo-nginx.sh
β”‚   β”‚   β”‚   └── 30-init-maintenance-nginx.sh
β”‚   β”‚   β”œβ”€β”€ kobo-docker-scripts
β”‚   β”‚   β”‚   β”œβ”€β”€ include.server_directive_common.conf
β”‚   β”‚   β”‚   β”œβ”€β”€ nginx.conf
β”‚   β”‚   β”‚   └── templates
β”‚   β”‚   β”‚       β”œβ”€β”€ include.https_redirection.conf.tmpl
β”‚   β”‚   β”‚       β”œβ”€β”€ maintenance_default.conf.tmpl
β”‚   β”‚   β”‚       β”œβ”€β”€ nginx_site_default.conf.tmpl
β”‚   β”‚   β”‚       β”œβ”€β”€ proxy_pass.conf.tmpl
β”‚   β”‚   β”‚       └── uwsgi_pass.conf.tmpl
β”‚   β”‚   └── maintenance
β”‚   β”‚       β”œβ”€β”€ apple-touch-icon-114x114.png
β”‚   β”‚       β”œβ”€β”€ apple-touch-icon-72x72.png
β”‚   β”‚       β”œβ”€β”€ apple-touch-icon.png
β”‚   β”‚       β”œβ”€β”€ apple-touch-icon-precomposed.png
β”‚   β”‚       β”œβ”€β”€ background.jpg
β”‚   β”‚       β”œβ”€β”€ favicon.ico
β”‚   β”‚       β”œβ”€β”€ huge-background.jpg
β”‚   β”‚       β”œβ”€β”€ index.html.tmpl
β”‚   β”‚       └── kobologo.svg
β”‚   β”œβ”€β”€ postgres
β”‚   β”‚   β”œβ”€β”€ backup-to-disk.bash
β”‚   β”‚   β”œβ”€β”€ backup-to-s3.py
β”‚   β”‚   β”œβ”€β”€ entrypoint.sh
β”‚   β”‚   β”œβ”€β”€ master
β”‚   β”‚   β”‚   └── postgres.conf
β”‚   β”‚   β”œβ”€β”€ primary
β”‚   β”‚   β”‚   β”œβ”€β”€ clone_data_from_kc_to_kpi.sh
β”‚   β”‚   β”‚   β”œβ”€β”€ drop_kpi_tables_in_kc.sh
β”‚   β”‚   β”‚   β”œβ”€β”€ init_01_replication.sh
β”‚   β”‚   β”‚   └── postgres.conf
β”‚   β”‚   β”œβ”€β”€ secondary
β”‚   β”‚   β”‚   β”œβ”€β”€ failover.sh
β”‚   β”‚   β”‚   β”œβ”€β”€ init_01_replication.sh
β”‚   β”‚   β”‚   β”œβ”€β”€ postgres.conf
β”‚   β”‚   β”‚   └── recovery.conf
β”‚   β”‚   β”œβ”€β”€ shared
β”‚   β”‚   β”‚   β”œβ”€β”€ init_02_set_postgres_config.sh
β”‚   β”‚   β”‚   β”œβ”€β”€ init_03_firstrun.sh
β”‚   β”‚   β”‚   β”œβ”€β”€ pg_hba.conf
β”‚   β”‚   β”‚   β”œβ”€β”€ postgres.conf
β”‚   β”‚   β”‚   └── upsert_users.sh
β”‚   β”‚   └── toggle-backup-activation.sh
β”‚   β”œβ”€β”€ README.md
β”‚   β”œβ”€β”€ redis
β”‚   β”‚   β”œβ”€β”€ backup-to-disk.bash
β”‚   β”‚   β”œβ”€β”€ backup-to-s3.py
β”‚   β”‚   β”œβ”€β”€ entrypoint.sh
β”‚   β”‚   β”œβ”€β”€ redis-enketo-cache.conf.tmpl
β”‚   β”‚   β”œβ”€β”€ redis-enketo-main.conf.tmpl
β”‚   β”‚   └── toggle-backup-activation.sh
β”‚   β”œβ”€β”€ scripts
β”‚   β”‚   β”œβ”€β”€ runtime_variables_kobocat.source.bash
β”‚   β”‚   β”œβ”€β”€ runtime_variables_kpi.source.bash
β”‚   β”‚   β”œβ”€β”€ wait_for_kpi.bash
β”‚   β”‚   β”œβ”€β”€ wait_for_mongo.bash
β”‚   β”‚   └── wait_for_postgres.bash
β”‚   └── uwsgi
β”‚       β”œβ”€β”€ kc_uwsgi.ini
β”‚       └── kpi_uwsgi.ini
β”œβ”€β”€ kobo-env
β”‚   β”œβ”€β”€ enketo_express
β”‚   β”‚   └── config.json
β”‚   β”œβ”€β”€ envfiles
β”‚   β”‚   β”œβ”€β”€ aws.txt
β”‚   β”‚   β”œβ”€β”€ databases.txt
β”‚   β”‚   β”œβ”€β”€ enketo.txt
β”‚   β”‚   β”œβ”€β”€ external_services.txt
β”‚   β”‚   β”œβ”€β”€ kobocat.txt
β”‚   β”‚   β”œβ”€β”€ kpi.txt
β”‚   β”‚   β”œβ”€β”€ nginx.txt
β”‚   β”‚   └── smtp.txt
β”‚   β”œβ”€β”€ envfile.txt
β”‚   └── postgres
β”‚       β”œβ”€β”€ primary
β”‚       β”‚   └── postgres.conf
β”‚       └── secondary
β”‚           └── postgres.conf
└── kobo-install
    β”œβ”€β”€ conftest.py
    β”œβ”€β”€ helpers
    β”‚   β”œβ”€β”€ aws_validation.py
    β”‚   β”œβ”€β”€ cli.py
    β”‚   β”œβ”€β”€ command.py
    β”‚   β”œβ”€β”€ config.py
    β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”œβ”€β”€ network.py
    β”‚   β”œβ”€β”€ __pycache__
    β”‚   β”‚   β”œβ”€β”€ aws_validation.cpython-36.pyc
    β”‚   β”‚   β”œβ”€β”€ cli.cpython-36.pyc
    β”‚   β”‚   β”œβ”€β”€ command.cpython-36.pyc
    β”‚   β”‚   β”œβ”€β”€ config.cpython-36.pyc
    β”‚   β”‚   β”œβ”€β”€ __init__.cpython-36.pyc
    β”‚   β”‚   β”œβ”€β”€ network.cpython-36.pyc
    β”‚   β”‚   β”œβ”€β”€ setup.cpython-36.pyc
    β”‚   β”‚   β”œβ”€β”€ singleton.cpython-36.pyc
    β”‚   β”‚   β”œβ”€β”€ template.cpython-36.pyc
    β”‚   β”‚   β”œβ”€β”€ updater.cpython-36.pyc
    β”‚   β”‚   └── upgrading.cpython-36.pyc
    β”‚   β”œβ”€β”€ setup.py
    β”‚   β”œβ”€β”€ singleton.py
    β”‚   β”œβ”€β”€ template.py
    β”‚   β”œβ”€β”€ updater.py
    β”‚   └── upgrading.py
    β”œβ”€β”€ readme.md
    β”œβ”€β”€ requirements_tests.txt
    β”œβ”€β”€ run.py
    β”œβ”€β”€ setup.py
    β”œβ”€β”€ templates
    β”‚   β”œβ”€β”€ kobo-docker
    β”‚   β”‚   β”œβ”€β”€ docker-compose.backend.primary.override.yml.tpl
    β”‚   β”‚   β”œβ”€β”€ docker-compose.backend.secondary.override.yml.tpl
    β”‚   β”‚   β”œβ”€β”€ docker-compose.frontend.override.yml.tpl
    β”‚   β”‚   └── docker-compose.maintenance.override.yml.tpl
    β”‚   β”œβ”€β”€ kobo-env
    β”‚   β”‚   β”œβ”€β”€ enketo_express
    β”‚   β”‚   β”‚   └── config.json.tpl
    β”‚   β”‚   β”œβ”€β”€ envfiles
    β”‚   β”‚   β”‚   β”œβ”€β”€ aws.txt.tpl
    β”‚   β”‚   β”‚   β”œβ”€β”€ databases.txt.tpl
    β”‚   β”‚   β”‚   β”œβ”€β”€ enketo.txt.tpl
    β”‚   β”‚   β”‚   β”œβ”€β”€ external_services.txt.tpl
    β”‚   β”‚   β”‚   β”œβ”€β”€ kobocat.txt.tpl
    β”‚   β”‚   β”‚   β”œβ”€β”€ kpi.txt.tpl
    β”‚   β”‚   β”‚   β”œβ”€β”€ nginx.txt.tpl
    β”‚   β”‚   β”‚   └── smtp.txt.tpl
    β”‚   β”‚   β”œβ”€β”€ envfile.txt.tpl
    β”‚   β”‚   └── postgres
    β”‚   β”‚       β”œβ”€β”€ primary
    β”‚   β”‚       β”‚   └── postgres.conf.tpl
    β”‚   β”‚       └── secondary
    β”‚   β”‚           └── postgres.conf.tpl
    β”‚   └── nginx-certbot
    β”‚       β”œβ”€β”€ data
    β”‚       β”‚   └── nginx
    β”‚       β”‚       └── app.conf.tpl
    β”‚       └── init-letsencrypt.sh.tpl
    β”œβ”€β”€ tests
    β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”œβ”€β”€ test_config.py
    β”‚   β”œβ”€β”€ test_run.py
    β”‚   └── utils.py
    └── tox.ini

these are my files!!

Hi @Roger963, from your kobo-install directory you can run this to get into the kobocat container:

./run.py -cf exec kobocat bash

or otherwise run:

docker exec -it $(docker ps | grep kobocat | awk '{print $1}') bash

and then from inside the container you can run the ./manage.py command.

2 Likes