[ckan-dev] Initializing/cleaning the database
David Read
david.read at hackneyworkshop.com
Tue Sep 17 09:29:20 UTC 2013
Pabitra,
'paster db clean' should only take a few seconds. I've seen it stop
too, and I guess it is to do with needing database connections to be
released by a paster or apache process - so try quiting/restarting
those - that often works. Or restarting postgres itself is pretty
reliable to sort it.
David
On 16 September 2013 11:11, Richard Gomes <rgomes.info at gmail.com> wrote:
> Hello,
>
> I suppose you are willing to reset the entire database.
> This is what I do:
>
> #!/bin/bash
>
> set -x
>
> VENV=default
> source ~/.virtualenvs/${VENV}/bin/activate
> source ~/.virtualenvs/${VENV}/bin/postactivate
>
> pushd $CKAN_HOME
>
> # remove proxy settings. see: https://github.com/okfn/ckan/issues/1213
> `env | fgrep -i _proxy | cut -d= -f1 | xargs echo unset`
>
> sudo -u postgres dropdb ${CKAN_DATABASE}
> sudo -u postgres dropuser ${CKAN_USERNAME}
>
>
> sudo -u postgres createuser -S -D -R -P ${CKAN_USERNAME}
> sudo -u postgres createdb -O ${CKAN_USERNAME} ${CKAN_DATABASE} -E utf-8
>
>
> paster db init -c $CKAN_ETC/default/development.ini
> paster search-index rebuild -c $CKAN_ETC/default/development.ini
> paster create-test-data -c $CKAN_ETC/default/development.ini
> paster search-index rebuild -c $CKAN_ETC/default/development.ini
> paster sysadmin add admin -c $CKAN_ETC/default/development.ini
>
> set +x
>
>
>
> Richard Gomes
> http://rgomes.info
> http://www.linkedin.com/in/rgomes
> mobile: +44(77)9955-6813
> inum: +883(5100)0800-9804
>
> On 15/09/13 04:24, Pabitra Dash wrote:
>
>
> Hello All,
>
> I am using the paster to delete all tables with the "db clean" command. I am
> not getting any output from this command even after waiting for a quite bit
> of time. I even tried the "db init" and the problem is the same. Any idea
> what I might be doing wrong?
>
> Thanks,
> Pabitra
>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
More information about the ckan-dev
mailing list