Port of OpenDataPhilly to CKAN
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.github Add document to track manual steps needed for 2.2->2.8 upgrade Aug 21, 2018
deployment/ansible Merge pull request #85 from azavea/feature/mvm/google-analytics Sep 19, 2018
UPGRADING_2.2_TO_2.8.md Add instructions for copying uploads between servers Sep 19, 2018



Port of OpenDataPhilly to CKAN

Development Dependencies

Development Installation

  1. Make sure you have the development dependencies installed
  2. Clone the ckanext-odp_theme repository to this directory's parent directory
  3. Copy deployment/ansible/group_vars/vagrant.example to vagrant and edit with your e-mail credentials. If e-mail credentials are left unconfigured, e-mails will not be sent out.
  4. Run vagrant up; once the Ansible provisioner finishes, CKAN will be available at http://localhost:8025
  5. Creating a sysadmin user:
  $ vagrant ssh app
  vagrant@app:~$ . /usr/lib/ckan/default/bin/activate
  vagrant@app:~$ cd /usr/lib/ckan/default/src/ckan
  vagrant@app:~$ ckan/ paster sysadmin add <USERNAME> -c /etc/ckan/default/production.ini


  1. Launch a server running Ubuntu 14.04. This server should be accessible from the deployment computer over SSH, and should have HTTP and HTTPS access to the internet.
  2. Copy deployment/ansible/hosts/hosts.staging.example to hosts.staging and enter the address of the server that was just launched.
  3. Copy deployment/ansible/group_vars/staging.example to staging and edit any settings you wish to change (see above). Make sure that ckan_site_url matches the address at which you will access the site.
  4. Run ANSIBLE_HOST_KEY_CHECKING=false ansible-playbook --private-key=/absolute/path/to/server/key/file.pem --user=ubuntu --inventory-file=deployment/ansible/hosts/hosts.staging deployment/ansible/staging.yml -v

Migrating database from host to host

Export the database from the source host

cd /usr/lib/ckan/default/src/ckan
/usr/lib/ckan/default/bin/paster db dump --config=/etc/ckan/default/production.ini /root/database.sql

Then move /root/database.sql to the destination host

On the destination host, shut down apache, clear the database, and load from file

service apache2 stop
cd /usr/lib/ckan/default/src/ckan
/usr/lib/ckan/default/bin/paster db clean --config=/etc/ckan/default/production.ini
psql -U ckan_default -h -W -d ckan_default -f /root/database.sql

Restart apache

service apache2 start

Re-index search (in /usr/lib/ckan/default/src/ckan)

/usr/lib/ckan/default/bin/paster search-index rebuild --config=/etc/ckan/default/production.ini

Rebuild views

ckan views create -y