[ckan-dev] Initializing/cleaning the database
Pabitra Dash
pkdash_reena at hotmail.com
Tue Sep 17 14:39:38 UTC 2013
Thanks David for your suggestion. I probably managed to do in essence what you have suggested. I disconnected the database using pgAdmin and then I got the paster command to clean the ckan database working.
Pabitra
> Date: Tue, 17 Sep 2013 10:29:20 +0100
> From: david.read at hackneyworkshop.com
> To: ckan-dev at lists.okfn.org
> Subject: Re: [ckan-dev] Initializing/cleaning the database
>
> 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
> >
>
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130917/dd275aae/attachment-0001.html>
More information about the ckan-dev
mailing list