Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade CKAN DB from 2.9 to 2.10 #4346

Closed
3 tasks
nickumia-reisys opened this issue Jun 8, 2023 · 3 comments
Closed
3 tasks

Upgrade CKAN DB from 2.9 to 2.10 #4346

nickumia-reisys opened this issue Jun 8, 2023 · 3 comments
Assignees

Comments

@nickumia-reisys
Copy link
Contributor

nickumia-reisys commented Jun 8, 2023

User Story

In order to be able to upgrade to the latest version of CKAN, the Data.gov O&M development team wants to ensure there is a solid procedure for how to upgrade the existing DBs in cloud.gov development, staging and prod.

Acceptance Criteria

  • GIVEN there is a CKAN 2.9 DB
    WHEN @FuhuXia's DB upgrade process happens
    THEN it is a CKAN 2.10 DB

Background

Related to

A DB upgrade was attempted for inventory on cloud.gov and it failed because it could not perform the DB operations outside of the flask web app context.
image
image

Security Considerations (required)

...

Sketch

  • Document @FuhuXia's process
  • Test with inventory development
@FuhuXia
Copy link
Member

FuhuXia commented Jun 9, 2023

  1. Push an Ubuntu image to cloud.gov to install CKAN 2.10 on
cf push ckan-210 --docker-image ubuntu/apache2:2.4-20.04_edge
cf scale ckan-210 -m 2G -k 2G
cf ssh ckan-210
  1. Install CKAN 2.10
apt update
# install for ckan
apt install python3-dev libpq-dev python3-pip python3-venv git-core redis-server
# to fix an error about libmagic
apt install  libmagic-dev

mkdir -p /usr/lib/ckan/default
python3 -m venv /usr/lib/ckan/default
. /usr/lib/ckan/default/bin/activate
pip install --upgrade pip
pip install -e 'git+https://github.com/ckan/[email protected]#egg=ckan[requirements]'
deactivate
. /usr/lib/ckan/default/bin/activate

mkdir -p /etc/ckan/default
ckan generate config /etc/ckan/default/ckan.ini
  1. Edit ckan.ini to use existing sqlalchemy connections, solr connection, redis connection, and ckan.site_id value
vi /etc/ckan/default/ckan.ini
  1. Upgrade DB
# within the same virtualenv above
ckan -c /etc/ckan/default/ckan.ini db upgrade
  • notes
  1. Try with a ckan 2.9 install first and make sure you can run a harmless ckan user list to verify everything works before trying ckan 2.10.
  2. For catalog, dont forget https://github.com/GSA/catalog.data.gov#note-on-db-migration

@FuhuXia
Copy link
Member

FuhuXia commented Jun 9, 2023

Above steps were proven to be working, inventory DB on development space was upgraded from CKAN 2.9.8 to CKAN 2.10.1

@jbrown-xentity
Copy link
Contributor

This may not be needed at this time, as some other bugs were fixed in order that this is not necessary. Closing for now.

@github-project-automation github-project-automation bot moved this from 🏗 In Progress [8] to ✔ Done in data.gov team board Jun 12, 2023
@hkdctol hkdctol moved this from ✔ Done to 🗄 Closed in data.gov team board Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants