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

Ckan 2.10 upgrade #88

Merged
merged 11 commits into from
Sep 23, 2024
Merged

Ckan 2.10 upgrade #88

merged 11 commits into from
Sep 23, 2024

Conversation

mpolidori
Copy link
Member

Testing the upgrade

On the master branch, build/start CKAN (this is the old CKAN 2.7 with Python 2—you need to seed this portal first before testing the migration). All commands should be run in ckan-cloud-docker (unless stated otherwise).

  1. Run make secret (just go with the default values)
  2. Apply the following changes:
    diff --git a/.docker-compose.vital-strategies-theme.yaml b/.docker-compose.vital-strategies-theme.yaml
    index 9fd04c9..7a350fd 100644
    --- a/.docker-compose.vital-strategies-theme.yaml
    +++ b/.docker-compose.vital-strategies-theme.yaml
    @@ -39,6 +39,8 @@ services:
               cd ~/venv/src/ckanext-querytool && ~/venv/bin/python setup.py compile_catalog -l zh_CN -f
         environment:
           - CKAN_CONFIG_TEMPLATE_PREFIX=vital-strategies-theme-
    +    ports:
    +      - "5000:5000"
     
       jobs:
         image: viderum/ckan-cloud-docker:ckan-latest-vital-strategies-theme
    diff --git a/docker-compose.yaml b/docker-compose.yaml
    index e762d1f..a2084f3 100644
    --- a/docker-compose.yaml
    +++ b/docker-compose.yaml
    @@ -6,7 +6,7 @@ services:
         image: traefik:1.7.2-alpine
         restart: always
         volumes:
    -      - ./traefik/traefik.toml:/traefik.toml
    +      - ./traefik/traefik.dev.toml:/traefik.toml
           - ./traefik/acme.json:/acme.json
         networks:
         - ckan-multi
    diff --git a/docker-compose/ckan-conf-templates/vital-strategies-theme-production.ini.template b/docker-compose/ckan-conf-templates/vital-strategies-theme-production.ini.template
    index ecda824..412a779 100644
    --- a/docker-compose/ckan-conf-templates/vital-strategies-theme-production.ini.template
    +++ b/docker-compose/ckan-conf-templates/vital-strategies-theme-production.ini.template
    @@ -88,9 +88,11 @@ ckan.plugins = image_view
        geojson_view
        querytool
        stats
    -   sentry
    -   s3filestore
    -   googleanalytics
    +
    +
    +#   sentry
    +#   s3filestore
    +#   googleanalytics
     
     # Define which views should be created by default
     # (plugins must be loaded in ckan.plugins)
     
    
  3. Start/build the containers: make start O=vital-strategies
  4. Create a sysadmin user: make shell O=vital-strategies S=ckan C="/usr/lib/ckan/venv/bin/paster --plugin=ckan sysadmin add ckan_admin password=test1234 [email protected] -c /etc/ckan/production.ini"
  5. Seed the portal: make shell O=vital-strategies S=ckan C="/usr/lib/ckan/venv/bin/paster --plugin=ckanext-querytool seed_portal -c /etc/ckan/production.ini"
  6. While the containers are still running, switch to the new branch: git switch ckan-2.10-upgrade (you might need to git stash first, but make sure the changes from step 2 are re-applied before rebuilding/starting again)
  7. Dump the DBs: make backup-db O=vital-strategies (confirm that you have ckan.dump, datastore.dump and ckan_data.tar.gz in the current directory after running this command)
  8. Stop the containers: make stop O=vital-strategies
  9. Specify that we want to use datapusher-plus: export DATAPUSHER_TYPE=datapusher-plus (always do this in the current terminal session before starting up CKAN 2.10/Python 3 with ckan-cloud-docker)
  10. Clean and rebuild: make clean-rebuild O=vital-strategies
  11. Run the upgrade script: make upgrade-db O=vital-strategies
  12. Stop the containers: make stop O=vital-strategies (copy the API token that's output at the end, for the next step)
  13. Run make secret again and paste the token when prompted (step 13—"Enter Datapusher API token")
  14. Start the containers: make start O=vital-strategies
  15. Test and confirm that the migration was successful (your portal should have all of the data from the seed: an Organization, Groups, Datasets, Reports, and Visualizations)

Note: The first time you visit the DataStore tab for a given resource, it will say "Error: cannot connect to datapusher". If you click "Upload to DataStore", this error will go away and the process will complete as expected.

Copy link
Member

@luccasmmg luccasmmg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@luccasmmg luccasmmg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mpolidori mpolidori merged commit b90327f into master Sep 23, 2024
1 check failed
@mpolidori mpolidori deleted the ckan-2.10-upgrade branch September 23, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants