[ckan-dev] Initializing/cleaning the database

Richard Gomes rgomes.info at gmail.com
Mon Sep 16 10:11:06 UTC 2013


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 <http://www.inum.net/>: +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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130916/57e1f670/attachment-0001.html>


More information about the ckan-dev mailing list