mskcc / smile-server

2 stars 4 forks source link

Migrate Neo4j from v4.4.23 --> v5.19.0 #1276

Closed ao508 closed 1 week ago

ao508 commented 2 months ago

REMAINING TASKS:


In addition to migrating the database and verifying its integrity..

Other items that will need to be done:

Coordinating migration:

ao508 commented 2 months ago

Notes from #1263

PAUSED FOR THE TIME BEING

Neo4j pattern matching is supported in graphql for Neo4j v5.x.x which will require a major db version migration on our part.

It's recommended to incrementally migrate db versions. Ours is at 4.4.23 (need to double check how many migration steps this would require to reach 5.19.0)

The latest Neo4j version is v5.23.0 but APOC is supported up until v5.19.0 so far which is motivation for only migrating up to v5.19.0.

Resources and things to keep in mind:

Steps run:

  1. using docker... make a database dump for the current version of the database (neo4j:4.4.23)
  neo4j-admin-dump:
    container_name: neo4j-admin-dump
    image: neo4j/neo4j-admin:4.4.23
    restart: unless-stopped
    environment:
      - NEO4J_AUTH=${NEO4J_USERNAME}/${NEO4J_PASSWORD}
      - NEO4J_ACCEPT_LICENSE_AGREEMENT=yes
      - NEO4J_dbms_allow__upgrade=true
    command: neo4j-admin dump --database=neo4j --to=/downloads/neo4j.dump
    volumes:
      - type: bind
        source: /Users/laptop/data/neo4j/data
        target: /data
      - type: bind
        source: /Users/laptop/data/neo4j/import
        target: /import
      - type: bind
        source: /Users/laptop/data/neo4j/logs
        target: /logs
      - type: bind
        source: /Users/laptop/data/neo4j/plugins
        target: /plugins
      - type: bind
        source: /Users/laptop/data/neo4j/downloads
        target: /downloads

because of the bind mounting, the data dump will be written to the mounted /downloads path

  1. downloaded neo4j 5.19.0 community edition (as tar.gz, not using the neo4j desktop app)
  2. from the unpacked directory:
# migrate the database
laptop@LSKI3053 neo4j-community-5.19.0 % bin/neo4j-admin database migrate neo4j

# load the database
neo4j-community-5.19.0 % bin/neo4j-admin database load neo4j --from-path=/Users/laptop/data/neo4j/downloads
  1. Launch neo4j like normal via docker-compose, making sure to update the image to 5.19.0
ao508 commented 2 months ago

PRs:

smile-dashboard: https://github.com/mskcc/smile-dashboard/pull/160/files smile-configuration: https://github.mskcc.org/cmo/smile-configuration/pull/137 smile-deployment: https://github.mskcc.org/cmo/smile-deployment/pull/185 smile-server: coming soon

ao508 commented 2 months ago

After a lot of consideration, it might be best to migrate away from SDN+OGM hybrid to just SDN.