├── dump-postgres └── postgres_dump_here ├── dockerfiles ├── docker │ └── postgres │ │ ├── dummy.sql │ │ ├── Dockerfile │ │ └── scripts │ │ └── prepara-postgres.sh ├── Dockerfile_backend ├── Dockerfile_frontend ├── docker-compose_frontend.yml ├── docker-compose_restart.yml ├── docker-compose_migration.yml └── old-solr-xml.xml ├── upgrade-variables.properties.EXAMPLE ├── _default_instalation_variables.properties ├── ibict_upgrade-variables.properties.EXAMPLE ├── restart-backend.sh ├── .gitignore ├── local.cfg ├── create-dspace7.sh ├── frontend_rebuild.sh ├── frontend_recreateinstall.sh ├── backend_remove.sh ├── restart-frontend.sh ├── update-restart-backend.sh ├── upgrade-to-dspace7.sh ├── migrate-solr.sh ├── default-ibict └── config │ └── item-submission.xml ├── frontend_build.sh ├── readme.md ├── backend_build.sh └── license.md /dump-postgres/postgres_dump_here: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dockerfiles/docker/postgres/dummy.sql: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /upgrade-variables.properties.EXAMPLE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projetos-codic-ibict/dspace-updater-tool/HEAD/upgrade-variables.properties.EXAMPLE -------------------------------------------------------------------------------- /_default_instalation_variables.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projetos-codic-ibict/dspace-updater-tool/HEAD/_default_instalation_variables.properties -------------------------------------------------------------------------------- /ibict_upgrade-variables.properties.EXAMPLE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projetos-codic-ibict/dspace-updater-tool/HEAD/ibict_upgrade-variables.properties.EXAMPLE -------------------------------------------------------------------------------- /restart-backend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker rm -f dspace7 || true > /dev/null 2>&1 4 | 5 | docker compose -f source/DSpace-dspace-7.6/docker-compose_restart.yml up -d 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /tmp/* 2 | /dspace-install-dir/* 3 | /postgres/* 4 | /dump-postgres/dump.sql 5 | /execution.log 6 | /source/* 7 | /upgrade-variables.properties 8 | /ibict_upgrade-variables.properties -------------------------------------------------------------------------------- /dockerfiles/Dockerfile_backend: -------------------------------------------------------------------------------- 1 | FROM tomcat:9-jdk11 2 | ENV TZ="America/Sao_Paulo" 3 | 4 | # Expose Tomcat port and AJP port 5 | EXPOSE 8080 8009 6 | # Give java extra memory (2GB) 7 | ENV JAVA_OPTS=-Xmx2000m 8 | -------------------------------------------------------------------------------- /local.cfg: -------------------------------------------------------------------------------- 1 | dspace.name=Novo DSpace 7 2 | default.language = pt_BR 3 | webui.supported.locales = pt_BR 4 | mail.server = smtp.example.com 5 | mail.server.port = 25 6 | mail.from.address = dspace-noreply@myu.edu 7 | feedback.recipient = dspace-help@myu.edu 8 | mail.admin = dspace-help@myu.edu 9 | -------------------------------------------------------------------------------- /dockerfiles/docker/postgres/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM postgres:12 2 | LABEL maintainer="Márcio Gurgel " 3 | 4 | EXPOSE 5432 5 | COPY *.sql /opt/ 6 | 7 | RUN echo "Iniciando a construção" 8 | COPY ./scripts/prepara-postgres.sh /docker-entrypoint-initdb.d/ 9 | RUN chmod -R 777 /opt 10 | RUN chmod 775 /docker-entrypoint-initdb.d/prepara-postgres.sh 11 | -------------------------------------------------------------------------------- /create-dspace7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./backend_remove.sh 4 | source ./backend_build.sh default-ibict 5 | source ./frontend_recreateinstall.sh 6 | 7 | printf ' 8 | -------------------------------------- 9 | \U00023F3 10 | -------------------------------------- 11 | \e[1mPT_BR\e[0m: Crie o seu primeiro usuário administrador do DSpace 12 | \e[1mEN\e[0m: Create the fist admin user 13 | ' 14 | docker exec -it dspace7 /dspace/bin/dspace create-administrator -------------------------------------------------------------------------------- /dockerfiles/docker/postgres/scripts/prepara-postgres.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | function cria_usuario_e_bd() { 6 | echo "Criando usuário DSpace" 7 | psql --username=postgres -c "CREATE USER dspace WITH PASSWORD 'cDVf9UnCskeirG4K';" 8 | psql --username=postgres -c "CREATE DATABASE dspace WITH OWNER dspace;" 9 | psql --username=postgres -c "GRANT ALL PRIVILEGES ON DATABASE dspace TO dspace;" 10 | } 11 | 12 | function instala_pg_crypto() { 13 | echo "Criando pgCrypto" 14 | psql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;" 15 | } 16 | 17 | cria_usuario_e_bd 18 | instala_pg_crypto 19 | 20 | if [[ -f /opt/dump.sql ]]; then 21 | echo "Identificado arquivo de DUMP efetuando a restauração" 22 | psql -d dspace -U dspace -f /opt/dump.sql 23 | fi -------------------------------------------------------------------------------- /frontend_rebuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | printf ' 5 | -------------------------------------- 6 | \U0001F180 7 | -------------------------------------- 8 | \e[1mPT_BR\e[0m: Frontend: Removendo arquivos e container de execuções antigas (caso eles existam). 9 | Sua senha root será solicitada. 10 | 11 | \e[1mEN\e[0m: Frontend: Deleting old files and containers from previous executions (in case they exists). 12 | Your root password will be requested. 13 | ' 14 | 15 | { 16 | rm dspace-7.6.zip || true > /dev/null 2>&1 > /dev/null 17 | sleep 1 18 | rm -rf ./source/dspace-angular-dspace-7.6 19 | 20 | docker rm -f dspace7-angular || true > /dev/null 2>&1 > /dev/null 21 | docker rmi -f docker_dspace7-angular || true > /dev/null 2>&1 > /dev/null 22 | } >> ./execution.log 2>&1 23 | 24 | source ./frontend_build.sh 25 | 26 | 27 | -------------------------------------------------------------------------------- /frontend_recreateinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | printf ' 4 | -------------------------------------- 5 | \U0001F180 6 | -------------------------------------- 7 | \e[1mPT_BR\e[0m: Frontend: Removendo arquivos e container de execuções antigas (caso eles existam). 8 | Sua senha root será solicitada. 9 | 10 | \e[1mEN\e[0m: Frontend: Deleting old files and containers from previous executions (in case they exists). 11 | Your root password will be requested. 12 | ' 13 | 14 | { 15 | rm dspace-7.6.zip || true > /dev/null 2>&1 > /dev/null 16 | sleep 1 17 | rm -rf ./source/dspace-angular-dspace-7.6 18 | 19 | docker rm -f dspace7-angular || true > /dev/null 2>&1 > /dev/null 20 | docker rmi -f docker-dspace7-angular || true > /dev/null 2>&1 > /dev/null 21 | } >> ./execution.log 2>&1 22 | 23 | source ./frontend_build.sh default-ibict 24 | -------------------------------------------------------------------------------- /dockerfiles/Dockerfile_frontend: -------------------------------------------------------------------------------- 1 | # This image will be published as dspace/dspace-angular 2 | # See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details 3 | 4 | FROM node:18-alpine 5 | WORKDIR /app 6 | ADD . /app/ 7 | EXPOSE 4000 8 | 9 | ENV TZ="America/Sao_Paulo" 10 | 11 | 12 | RUN export NODE_OPTIONS="--max-old-space-size=8192" 13 | # Ensure Python and other build tools are available 14 | # These are needed to install some node modules, especially on linux/arm64 15 | RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/* 16 | 17 | # We run yarn install with an increased network timeout (5min) to avoid "ESOCKETTIMEDOUT" errors from hub.docker.com 18 | # See, for example https://github.com/yarnpkg/yarn/issues/5540 19 | RUN yarn install --network-timeout 300000 20 | 21 | # On startup, run in DEVELOPMENT mode (this defaults to live reloading enabled, etc). 22 | # Listen / accept connections from all IP addresses. 23 | # NOTE: At this time it is only possible to run Docker container in Production mode 24 | # if you have a public IP. See https://github.com/DSpace/dspace-angular/issues/1485 25 | CMD yarn serve --host 0.0.0.0 26 | 27 | -------------------------------------------------------------------------------- /backend_remove.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | printf ' 4 | -------------------------------------- 5 | \U0001F170 6 | -------------------------------------- 7 | \e[1mPT_BR\e[0m: Backend: Removendo arquivos e container de execuções antigas (caso eles existam). 8 | Sua senha root será solicitada. 9 | 10 | \e[1mEN\e[0m: Backend Deleting old files and containers from previous executions (in case they exists). 11 | Your root password will be requested. 12 | ' 13 | 14 | { 15 | echo "" > execution.log 16 | sudo rm -rf ./tmp/* 17 | sudo rm -rf ./dspace-install-dir/* 18 | 19 | sudo rm -rf ./DSpace-dspace-7.6 || true 20 | sudo rm -rf ./source/DSpace-dspace-7.6 || true 21 | rm dspace-7.6.zip || true >/dev/null 2>&1 22 | 23 | docker rm -f dspace7 || true >/dev/null 2>&1 24 | docker rmi -f dspace-dspace-76-dspace7 || true >/dev/null 2>&1 25 | 26 | docker rm -f dspace7db || true >/dev/null 2>&1 27 | docker rm -f dspace7solr || true >/dev/null 2>&1 28 | docker rmi -f ibict/postgresdspace7 || true >/dev/null 2>&1 29 | 30 | docker volume rm dspace-dspace-76_solr_data || true >/dev/null 2>&1 31 | docker volume rm dspace-dspace-76_postgres_data || true >/dev/null 2>&1 32 | } >> execution.log 2>&1 33 | 34 | -------------------------------------------------------------------------------- /restart-frontend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | { 4 | docker rm -f dspace7-angular 5 | docker rm -f dspace-angular 6 | docker rmi -f docker_dspace7-angular 7 | 8 | source ./upgrade-variables.properties 9 | } >>./execution.log 2>&1 10 | 11 | 12 | 13 | if [[ "${FRONTEND_ADDRESS_GIT}" ]]; then 14 | 15 | printf ' 16 | -------------------------------------- 17 | 18 | -------------------------------------- 19 | \e[1mPT_BR\e[0m: O frontend está associado a um repositório git, atualizando código-fonte 20 | \e[1mEN\e[0m: Backend: The angular module is associated with a git repo, updating the source code 21 | ' 22 | { 23 | cd source/dspace-angular-dspace-7.6 24 | docker run --rm -e FRONTEND_ADDRESS_GIT:${FRONTEND_ADDRESS_GIT} -v $(pwd):/git -w /git alpine/git && 25 | git pull ${FRONTEND_ADDRESS_GIT} 26 | cd ../.. 27 | } >>./execution.log 2>&1 28 | fi 29 | 30 | printf ' 31 | -------------------------------------- 32 | \U0001F4C8 \t \U00023F3 33 | -------------------------------------- 34 | \e[1mPT_BR\e[0m: Backend: Recompilando módulo angular 35 | \e[1mEN\e[0m: Backend: Re-compiling the angular mudule 36 | ' 37 | { 38 | docker compose -f source/dspace-angular-dspace-7.6/docker/docker-compose.yml up --build -d 39 | } >>./execution.log 2>&1 40 | -------------------------------------------------------------------------------- /dockerfiles/docker-compose_frontend.yml: -------------------------------------------------------------------------------- 1 | # 2 | # The contents of this file are subject to the license and copyright 3 | # detailed in the LICENSE and NOTICE files at the root of the source 4 | # tree and available online at 5 | # 6 | # http://www.dspace.org/license/ 7 | # 8 | 9 | # Docker Compose for running the DSpace Angular UI for testing/development 10 | # Requires also running a REST API backend (either locally or remotely), 11 | # for example via 'docker-compose-rest.yml' 12 | version: '3.7' 13 | networks: 14 | dspacenet: 15 | services: 16 | dspace7-angular: 17 | container_name: dspace7-angular 18 | environment: 19 | DSPACE_UI_SSL: 'false' 20 | DSPACE_UI_HOST: '192.169.5.126' 21 | DSPACE_UI_PORT: '5000' 22 | DSPACE_UI_NAMESPACE: / 23 | DSPACE_REST_SSL: 'false' 24 | DSPACE_REST_HOST: '192.169.5.126' 25 | DSPACE_REST_PORT: '9080' 26 | DSPACE_REST_NAMESPACE: '/server' 27 | NODE_OPTIONS: '--max-old-space-size=8192' 28 | TZ: 'America/Sao_Paulo' 29 | build: 30 | context: .. 31 | dockerfile: Dockerfile 32 | networks: 33 | dspacenet: 34 | ports: 35 | - published: 4000 36 | target: 4000 37 | stdin_open: true 38 | tty: true 39 | extra_hosts: 40 | - "host.docker.internal:host-gateway" 41 | -------------------------------------------------------------------------------- /update-restart-backend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Copiand config/spring..." 4 | rm -rf dspace-install-dir/config/spring 5 | cp -r source/DSpace-dspace-7.6/dspace/config/spring ./dspace-install-dir/config/ 6 | 7 | # Maven 8 | echo "Executando maven..." 9 | docker run -v ~/.m2:/var/maven/.m2 -v "$(pwd)/source/DSpace-dspace-7.6":/tmp/dspacebuild -w /tmp/dspacebuild --rm -e MAVen_CONFIG=/var/maven/.m2 maven:3.8.6-openjdk-11 mvn -q --no-transfer-progress -Duser.home=/var/maven clean package -P dspace-oai,\!dspace-sword,\!dspace-swordv2,\!dspace-rdf,\!dspace-iiif 10 | 11 | # Ant 12 | echo "Executando ant..." 13 | docker run -v ~/.m2:/var/maven/.m2 -v $(pwd)/dspace-install-dir:/dspace -v $(pwd)/source/DSpace-dspace-7.6:/tmp/dspacebuild -w /tmp/dspacebuild --rm -e MAVen_CONFIG=/var/maven/.m2 maven:3.8.6-openjdk-11 /bin/bash -c "wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.12-bin.tar.gz && tar -xvzf apache-ant-1.10.12-bin.tar.gz && cd dspace/target/dspace-installer && ../../../apache-ant-1.10.12/bin/ant init_installation update_configs update_code update_webapps && cd ../../../ && rm -rf apache-ant-*" 14 | 15 | echo "Removendo container dspace7" 16 | docker rm -f dspace7 || true > /dev/null 2>&1 17 | 18 | echo "Iniciando container dspace7" 19 | docker compose -f source/DSpace-dspace-7.6/docker-compose_restart.yml up --build -d -------------------------------------------------------------------------------- /upgrade-to-dspace7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if ! command -v docker &> /dev/null; then 4 | printf ' 5 | ----------------ERROR----------------- 6 | \e[1mPT_BR\e[0m: O programa "docker" não está instalado. Instale em: https://docs.docker.com/engine/install/ 7 | \e[1mEN\e[0m: The "docker" program is not installed. Install it: https://docs.docker.com/engine/install/ 8 | -------------------------------------- 9 | ' 10 | exit 1 11 | fi 12 | 13 | # Verificar se o Docker está em execução 14 | if ! docker info &> /dev/null; then 15 | printf ' 16 | ----------------ERROR----------------- 17 | \e[1mPT_BR\e[0m: O programa "docker" não está em execução. 18 | \e[1mEN\e[0m: The "docker" program is not running. 19 | -------------------------------------- 20 | ' 21 | exit 1 22 | fi 23 | 24 | if [ "$EUID" -ne 0 ]; then 25 | printf ' 26 | ----------------ERROR----------------- 27 | \e[1mPT_BR\e[0m: Este programa precisa ser rodado como root. 28 | \e[1mEN\e[0m: It is necessary to run this program as root. 29 | -------------------------------------- 30 | ' 31 | exit 1 32 | fi 33 | 34 | # RAM in this machine 35 | total_ram=$(free -b | grep "Mem:" | awk '{print $2}') 36 | 37 | # Convert to GB 38 | total_ram_gb=$(echo "scale=2; $total_ram / (1024 * 1024 * 1024)" | bc) 39 | 40 | if (( $(echo "$total_ram_gb < 8" | bc -l) )); then 41 | printf ' 42 | ----------------ERROR----------------- 43 | \e[1mPT_BR\e[0m: É necessário ao menos 8GB de RAM para rodar este programa. 44 | \e[1mEN\e[0m: It is necessary to have at least 8GB of ram to run this program. 45 | -------------------------------------- 46 | ' 47 | exit 1 48 | fi 49 | 50 | 51 | source ./backend_remove.sh 52 | source ./backend_build.sh 53 | source ./frontend_rebuild.sh 54 | -------------------------------------------------------------------------------- /migrate-solr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | { 4 | 5 | cp ./dockerfiles/old-solr-xml.xml ./dspace-install-dir/webapps/solr/WEB-INF/web.xml 6 | 7 | 8 | mkdir -p ./tmp 9 | 10 | docker pull tomcat:8.5.89-jdk8-temurin-jammy 11 | docker rm -f tomcatsolr || true 12 | docker rm -f dspace7solr || true 13 | docker rm -f downloadsolrdata || true 14 | 15 | 16 | docker network create oldsolr 17 | echo "Setting up a Tomcat with the old Solr" 18 | docker run -d --net oldsolr --name tomcatsolr -p 7777:8080 -v $(pwd)/dspace-install-dir:/dspace -v $(pwd)/dspace-install-dir/webapps/solr:/usr/local/tomcat/webapps/solr -w /dspace tomcat:8.5.89-jdk8-temurin-jammy 19 | 20 | timeout 20s grep -q ' Server startup in ' <(docker logs tomcatsolr --follow) 21 | 22 | 23 | echo "Generating the solr dump" 24 | #sleep 10000 25 | 26 | docker run --rm --net oldsolr -v $(pwd):/unzip --name downloadsolrdata -w /unzip kubeless/unzip curl 'http://tomcatsolr:8080/solr/statistics/select?q=*%3A*&rows=99999999&wt=csv&indent=true&&fl=owner%2Csubmitter%2CisBot%2Cstatistics_type%2CpreviousWorkflowStep%2CworkflowItemId%2Cip%2Cdns%2CworkflowStep%2CuserAgent%2Ctype%2Cactor%2Creferrer%2Cuid%2CowningItem%2CbundleName%2Cid%2Ctime%2Cepersonid%2CowningColl%2CowningComm' -o ./tmp/export.csv -L 27 | 28 | 29 | sudo split -l 100000 ./tmp/export.csv ./tmp/solr_ 30 | 31 | echo "Handling the solr dump files" 32 | for file in ./tmp/solr_* 33 | do 34 | if [ "${file##*/}" != "solr_aa" ]; then 35 | docker run --rm -e PARCIAL_SOLR=${file} -v $(pwd)/tmp:/tmp -w /tmp intel/qat-crypto-base:qatsw-ubuntu \ 36 | sed -i '1s/^/owner,submitter,isBot,statistics_type,previousWorkflowStep,workflowItemId,ip,dns,workflowStep,userAgent,type,actor,referrer,uid,owningItem,bundleName,id,time,epersonid,owningColl,owningComm\n/' ${file##*/} 37 | fi 38 | done 39 | 40 | rm -rf ./dspace-install-dir/solr 41 | rm -rf ./dspace-install-dir/webapps 42 | 43 | docker rm -f tomcatsolr 44 | 45 | 46 | } >>./execution.log 2>&1 47 | -------------------------------------------------------------------------------- /dockerfiles/docker-compose_restart.yml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | 3 | 4 | services: 5 | 6 | dspace7db: 7 | build: 8 | context: ../postgres 9 | dockerfile: Dockerfile 10 | image: 11 | ibict/postgresdspace7 12 | container_name: dspace7db 13 | ports: 14 | - "127.0.0.1:8787:5432" 15 | environment: 16 | - POSTGRES_PASSWORD=xxxxx #Postgres password 17 | - TZ=America/Sao_Paulo 18 | networks: 19 | - dspacenet 20 | volumes: 21 | - postgres_data:/var/lib/postgresql/data 22 | 23 | dspace7: 24 | container_name: dspace7 25 | environment: 26 | dspace__P__dir: /dspace 27 | solr__P__server: http://dspace7solr:8983/solr 28 | TZ: 'America/Sao_Paulo' 29 | proxies__P__trusted__P__ipranges: '172.23.0' 30 | build: 31 | context: . 32 | dockerfile: Dockerfile 33 | networks: 34 | - dspacenet 35 | ports: 36 | - published: 8080 #Port for tomcat 37 | target: 8080 38 | stdin_open: true 39 | tty: true 40 | extra_hosts: 41 | - "host.docker.internal:host-gateway" 42 | volumes: 43 | # Keep DSpace assetstore directory between reboots 44 | - ../../dspace-install-dir:/dspace 45 | - m2:/root/.m2 46 | entrypoint: 47 | - /bin/bash 48 | - '-c' 49 | - | 50 | /dspace/bin/dspace database migrate ignored 51 | ln -s /dspace/webapps/server /usr/local/tomcat/webapps/ || true 52 | catalina.sh run 53 | 54 | # DSpace Solr container 55 | dspace7solr: 56 | container_name: dspace7solr 57 | # Uses official Solr image at https://hub.docker.com/_/solr/ 58 | image: solr:8.11-slim 59 | networks: 60 | dspacenet: 61 | ports: 62 | - "127.0.0.1:8983:8983" 63 | stdin_open: true 64 | tty: true 65 | working_dir: /var/solr/data 66 | volumes: 67 | - ../../dspace-install-dir/solr/authority/conf:/opt/solr/server/solr/configsets/authority/conf 68 | - ../../dspace-install-dir/solr/oai/conf/:/opt/solr/server/solr/configsets/oai/conf 69 | - ../../dspace-install-dir/solr/search/conf:/opt/solr/server/solr/configsets/search/conf 70 | - ../../dspace-install-dir/solr/statistics/conf:/opt/solr/server/solr/configsets/statistics/conf 71 | # Keep Solr data directory between reboots 72 | # - solr_data:/var/solr/data 73 | # Initialize all DSpace Solr cores using the mounted local configsets (see above), then start Solr 74 | # * First, run precreate-core to create the core (if it doesn't yet exist). If exists already, this is a no-op 75 | # * Second, copy updated configs from mounted configsets to this core. If it already existed, this updates core 76 | # to the latest configs. If it's a newly created core, this is a no-op. 77 | entrypoint: 78 | - /bin/bash 79 | - '-c' 80 | - | 81 | init-var-solr 82 | precreate-core authority /opt/solr/server/solr/configsets/authority 83 | cp -r -u /opt/solr/server/solr/configsets/authority/* authority 84 | precreate-core oai /opt/solr/server/solr/configsets/oai 85 | cp -r -u /opt/solr/server/solr/configsets/oai/* oai 86 | precreate-core search /opt/solr/server/solr/configsets/search 87 | cp -r -u /opt/solr/server/solr/configsets/search/* search 88 | precreate-core statistics /opt/solr/server/solr/configsets/statistics 89 | cp -r -u /opt/solr/server/solr/configsets/statistics/* statistics 90 | exec solr -f 91 | 92 | 93 | volumes: 94 | solr_data: 95 | m2: 96 | postgres_data: 97 | 98 | 99 | networks: 100 | dspacenet: 101 | name: dspacenet 102 | driver: bridge -------------------------------------------------------------------------------- /default-ibict/config/item-submission.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | org.dspace.app.rest.submit.step.CollectionStep 12 | collection 13 | submission 14 | 15 | 16 | submit.progressbar.describe.step1 17 | org.dspace.app.rest.submit.step.DescribeStep 18 | submission-form 19 | 20 | 21 | submit.progressbar.describe.step2 22 | org.dspace.app.rest.submit.step.DescribeStep 23 | submission-form 24 | 25 | 26 | submit.progressbar.describe.step3 27 | org.dspace.app.rest.submit.step.DescribeStep 28 | submission-form 29 | 30 | 31 | submit.progressbar.describe.step4 32 | org.dspace.app.rest.submit.step.DescribeStep 33 | submission-form 34 | 35 | 36 | submit.progressbar.describe.step5 37 | org.dspace.app.rest.submit.step.DescribeStep 38 | submission-form 39 | 40 | 41 | submit.progressbar.describe.step6 42 | org.dspace.app.rest.submit.step.DescribeStep 43 | submission-form 44 | 45 | 46 | submit.progressbar.describe.step7 47 | org.dspace.app.rest.submit.step.DescribeStep 48 | submission-form 49 | 50 | 51 | submit.progressbar.upload 52 | org.dspace.app.rest.submit.step.UploadStep 53 | upload 54 | 55 | 56 | submit.progressbar.license 57 | org.dspace.app.rest.submit.step.LicenseStep 58 | license 59 | submission 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /dockerfiles/docker-compose_migration.yml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | 3 | 4 | services: 5 | 6 | dspace7db: 7 | build: 8 | context: ../postgres 9 | dockerfile: Dockerfile 10 | image: 11 | ibict/postgresdspace7 12 | container_name: dspace7db 13 | ports: 14 | - "127.0.0.1:8787:5432" 15 | environment: 16 | - POSTGRES_PASSWORD=xxxxx #Postgres password 17 | - TZ=America/Sao_Paulo 18 | networks: 19 | - dspacenet 20 | volumes: 21 | - postgres_data:/var/lib/postgresql/data 22 | 23 | dspace7: 24 | container_name: dspace7 25 | environment: 26 | dspace__P__dir: /dspace 27 | solr__P__server: http://dspace7solr:8983/solr 28 | TZ: 'America/Sao_Paulo' 29 | proxies__P__trusted__P__ipranges: '172.23.0' 30 | build: 31 | context: . 32 | dockerfile: Dockerfile 33 | networks: 34 | - dspacenet 35 | ports: 36 | - published: 8080 #Port for tomcat 37 | target: 8080 38 | stdin_open: true 39 | tty: true 40 | extra_hosts: 41 | - "host.docker.internal:host-gateway" 42 | volumes: 43 | # Keep DSpace assetstore directory between reboots 44 | - ../../dspace-install-dir:/dspace 45 | - m2:/root/.m2 46 | entrypoint: 47 | - /bin/bash 48 | - '-c' 49 | - | 50 | /dspace/bin/dspace database migrate ignored 51 | mkdir /dspace/config/temp 52 | cp /dspace/config/item-submission.xml /dspace/config/temp 53 | cp /dspace/config/input-forms.xml /dspace/config/temp 54 | rm /dspace/config/spring/api/bte.xml 55 | rm /dspace/config/GeoLiteCity.dat 56 | /dspace/bin/dspace submission-forms-migrate -s /dspace/config/temp/item-submission.xml -f /dspace/config/temp/input-forms.xml 57 | mv /dspace/config/item-submission.xml.migrated /dspace/config/item-submission.xml 58 | mv /dspace/config/submission-forms.xml.migrated /dspace/config/submission-forms.xml 59 | sed -i 's///g' /dspace/config/item-submission.xml 60 | ln -s /dspace/webapps/server /usr/local/tomcat/webapps/ 61 | catalina.sh run 62 | 63 | # DSpace Solr container 64 | dspace7solr: 65 | container_name: dspace7solr 66 | # Uses official Solr image at https://hub.docker.com/_/solr/ 67 | image: solr:8.11-slim 68 | networks: 69 | dspacenet: 70 | ports: 71 | - "127.0.0.1:8983:8983" 72 | stdin_open: true 73 | tty: true 74 | working_dir: /var/solr/data 75 | volumes: 76 | - ../../dspace-install-dir/solr/authority/conf:/opt/solr/server/solr/configsets/authority/conf 77 | - ../../dspace-install-dir/solr/oai/conf/:/opt/solr/server/solr/configsets/oai/conf 78 | - ../../dspace-install-dir/solr/search/conf:/opt/solr/server/solr/configsets/search/conf 79 | - ../../dspace-install-dir/solr/statistics/conf:/opt/solr/server/solr/configsets/statistics/conf 80 | # Keep Solr data directory between reboots 81 | # - solr_data:/var/solr/data 82 | # Initialize all DSpace Solr cores using the mounted local configsets (see above), then start Solr 83 | # * First, run precreate-core to create the core (if it doesn't yet exist). If exists already, this is a no-op 84 | # * Second, copy updated configs from mounted configsets to this core. If it already existed, this updates core 85 | # to the latest configs. If it's a newly created core, this is a no-op. 86 | entrypoint: 87 | - /bin/bash 88 | - '-c' 89 | - | 90 | init-var-solr 91 | precreate-core authority /opt/solr/server/solr/configsets/authority 92 | cp -r -u /opt/solr/server/solr/configsets/authority/* authority 93 | precreate-core oai /opt/solr/server/solr/configsets/oai 94 | cp -r -u /opt/solr/server/solr/configsets/oai/* oai 95 | precreate-core search /opt/solr/server/solr/configsets/search 96 | cp -r -u /opt/solr/server/solr/configsets/search/* search 97 | precreate-core statistics /opt/solr/server/solr/configsets/statistics 98 | cp -r -u /opt/solr/server/solr/configsets/statistics/* statistics 99 | exec solr -f 100 | 101 | 102 | volumes: 103 | solr_data: 104 | m2: 105 | postgres_data: 106 | 107 | 108 | networks: 109 | dspacenet: 110 | name: dspacenet 111 | driver: bridge -------------------------------------------------------------------------------- /dockerfiles/old-solr-xml.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | 15 | 25 | 26 | 29 | 36 | 37 | 38 | 39 | 40 | 41 | SolrRequestFilter 42 | org.apache.solr.servlet.SolrDispatchFilter 43 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 80 | SolrRequestFilter 81 | /* 82 | 83 | 84 | 85 | 86 | 87 | org.dspace.solr.filters.ConfigureLog4jListener 88 | 89 | 90 | 91 | Zookeeper 92 | org.apache.solr.servlet.ZookeeperInfoServlet 93 | 94 | 95 | 96 | LoadAdminUI 97 | org.apache.solr.servlet.LoadAdminUiServlet 98 | 99 | 100 | 101 | 102 | 103 | RedirectOldAdminUI 104 | org.apache.solr.servlet.RedirectServlet 105 | 106 | destination 107 | ${context}/#/ 108 | 109 | 110 | 111 | 112 | RedirectOldZookeeper 113 | org.apache.solr.servlet.RedirectServlet 114 | 115 | destination 116 | ${context}/zookeeper 117 | 118 | 119 | 120 | 121 | RedirectLogging 122 | org.apache.solr.servlet.RedirectServlet 123 | 124 | destination 125 | ${context}/#/~logging 126 | 127 | 128 | 129 | 130 | SolrRestApi 131 | org.restlet.ext.servlet.ServerServlet 132 | 133 | org.restlet.application 134 | org.apache.solr.rest.SolrRestApi 135 | 136 | 137 | 138 | 139 | RedirectOldAdminUI 140 | /admin/ 141 | 142 | 143 | RedirectOldAdminUI 144 | /admin 145 | 146 | 147 | RedirectOldZookeeper 148 | /zookeeper.jsp 149 | 150 | 151 | RedirectLogging 152 | /logging 153 | 154 | 155 | 156 | 157 | Zookeeper 158 | /zookeeper 159 | 160 | 161 | 162 | LoadAdminUI 163 | /admin.html 164 | 165 | 166 | 167 | SolrRestApi 168 | /schema/* 169 | 170 | 171 | 172 | .xsl 173 | 174 | application/xslt+xml 175 | 176 | 177 | 178 | admin.html 179 | 180 | 181 | 184 | 185 | solr/home 186 | /dspace/solr 187 | java.lang.String 188 | 189 | 190 | 191 | -------------------------------------------------------------------------------- /frontend_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | printf ' 4 | -------------------------------------- 5 | \U0001F181 6 | -------------------------------------- 7 | \e[1mPT_BR\e[0m: Frontend: Removendo arquivos e container de execuções antigas (caso eles existam). 8 | Sua senha root será solicitada. 9 | 10 | \e[1mEN\e[0m: Frontend: Deleting old files and containers from previous executions (in case they exists). 11 | Your root password will be requested. 12 | ' 13 | { 14 | if ! [[ $1 ]]; then 15 | source ./upgrade-variables.properties 16 | else 17 | source ./ibict_upgrade-variables.properties 18 | source ./_default_instalation_variables.properties 19 | fi 20 | 21 | docker pull intel/qat-crypto-base:qatsw-ubuntu 22 | docker pull kubeless/unzip 23 | } >>./execution.log 2>&1 24 | 25 | 26 | if [[ "${FRONTEND_ADDRESS_GIT}" ]]; then 27 | printf ' 28 | -------------------------------------- 29 | \U0001F182 30 | -------------------------------------- 31 | \e[1mPT_BR\e[0m: Frontend: Clonando o repositório GIT especificado como fonte para o DSpace 7.6 32 | \e[1mEN\e[0m: Frontend: Cloning the GIT repo specified as DSpace 7.6 source 33 | ' 34 | { 35 | docker run --rm -e FRONTEND_ADDRESS_GIT:${FRONTEND_ADDRESS_GIT} -v $(pwd):/git -w /git alpine/git && \ 36 | git clone --depth 1 ${FRONTEND_ADDRESS_GIT} dspace-angular-dspace-7.6 37 | } >>./execution.log 2>&1 38 | 39 | else 40 | printf ' 41 | -------------------------------------- 42 | \U0001F183 43 | -------------------------------------- 44 | \e[1mPT_BR\e[0m Backend: Efetuando o download do fonte do DSpace 7.6 do GitHub do DSpace 45 | \e[1mEN\e[0m: Backend: Downloading the source of DSpace 7.6 from DSpace Github 46 | ' 47 | { 48 | docker run --rm -v $(pwd):/unzip -w /unzip kubeless/unzip && \ 49 | curl https://github.com/DSpace/dspace-angular/archive/refs/tags/dspace-7.6.zip -o dspace-7.6.zip -L && \ 50 | unzip -q dspace-7.6.zip && \ 51 | rm dspace-7.6.zip && \ 52 | rm -rf dspace-7.6 53 | } >>./execution.log 2>&1 54 | 55 | fi 56 | 57 | printf ' 58 | -------------------------------------- 59 | \U0001F184 60 | -------------------------------------- 61 | \e[1mPT_BR\e[0m: Backend: Efetuando substituição de variáveis nos arquivos de deployment do DSpace. 62 | \e[1mEN\e[0m: Backend: Filling the variables in the deployment files. 63 | ' 64 | 65 | { 66 | mkdir source || true >/dev/null 2>&1 67 | mv dspace-angular-dspace-7.6 source 68 | cp ./dockerfiles/Dockerfile_frontend source/dspace-angular-dspace-7.6/Dockerfile 69 | cp ./dockerfiles/docker-compose_frontend.yml source/dspace-angular-dspace-7.6/docker/docker-compose.yml 70 | 71 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6/docker:/root -w /root intel/qat-crypto-base:qatsw-ubuntu \ 72 | sed -i -E "s/DSPACE_UI_SSL: '(.*)'/DSPACE_UI_SSL: '${FRONTEND_USES_SSL}'/g" /root/docker-compose.yml 73 | 74 | 75 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6/docker:/root intel/qat-crypto-base:qatsw-ubuntu \ 76 | sed -i -E "s/DSPACE_UI_HOST: '(.*)'/DSPACE_UI_HOST: '${FRONTEND_HOSTNAME}'/g" /root/docker-compose.yml 77 | 78 | 79 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6/docker:/root intel/qat-crypto-base:qatsw-ubuntu \ 80 | sed -i -E "s/DSPACE_UI_PORT: '(.*)'/DSPACE_UI_PORT: '${FRONTEND_PORT}'/g" /root/docker-compose.yml 81 | 82 | 83 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6/docker:/root intel/qat-crypto-base:qatsw-ubuntu \ 84 | sed -i -E "s/published: (.*)/published: ${FRONTEND_PORT}/g" /root/docker-compose.yml 85 | 86 | 87 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6/docker:/root intel/qat-crypto-base:qatsw-ubuntu \ 88 | sed -i -E "s/target: (.*)/target: ${FRONTEND_PORT}/g" /root/docker-compose.yml 89 | 90 | 91 | if [ -n "$REVERSE_PROXY_BACKEND_USES_SSL" ]; then 92 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6/docker:/root intel/qat-crypto-base:qatsw-ubuntu \ 93 | sed -i -E "s/DSPACE_REST_SSL: '(.*)'/DSPACE_REST_SSL: '${REVERSE_PROXY_BACKEND_USES_SSL}'/g" /root/docker-compose.yml 94 | else 95 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6/docker:/root intel/qat-crypto-base:qatsw-ubuntu \ 96 | sed -i -E "s/DSPACE_REST_SSL: '(.*)'/DSPACE_REST_SSL: '${BACKEND_USES_SSL}'/g" /root/docker-compose.yml 97 | fi 98 | 99 | 100 | if [ -n "$REVERSE_PROXY_BACKEND_HOSTNAME" ]; then 101 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6/docker:/root intel/qat-crypto-base:qatsw-ubuntu \ 102 | sed -i -E "s/DSPACE_REST_HOST: '(.*)'/DSPACE_REST_HOST: '${REVERSE_PROXY_BACKEND_HOSTNAME}'/g" /root/docker-compose.yml 103 | else 104 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6/docker:/root intel/qat-crypto-base:qatsw-ubuntu \ 105 | sed -i -E "s/DSPACE_REST_HOST: '(.*)'/DSPACE_REST_HOST: '${BACKEND_HOSTNAME}'/g" /root/docker-compose.yml 106 | fi 107 | 108 | 109 | if [ -n "$REVERSE_PROXY_BACKEND_PORT" ]; then 110 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6/docker:/root intel/qat-crypto-base:qatsw-ubuntu \ 111 | sed -i -E "s/DSPACE_REST_PORT: '(.*)'/DSPACE_REST_PORT: '${REVERSE_PROXY_BACKEND_PORT}'/g" /root/docker-compose.yml 112 | else 113 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6/docker:/root intel/qat-crypto-base:qatsw-ubuntu \ 114 | sed -i -E "s/DSPACE_REST_PORT: '(.*)'/DSPACE_REST_PORT: '${BACKEND_PORT}'/g" /root/docker-compose.yml 115 | fi 116 | 117 | 118 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6:/root intel/qat-crypto-base:qatsw-ubuntu \ 119 | sed -i -E "s/\/\/ Angular Universal settings/defaultLanguage: 'pt_BR',/g" /root/src/environments/environment.ts 120 | 121 | 122 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6:/root intel/qat-crypto-base:qatsw-ubuntu \ 123 | sed -i -E "s/production\: false/production\: true/g" /root/src/environments/environment.ts 124 | 125 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6:/root intel/qat-crypto-base:qatsw-ubuntu \ 126 | sed -i -E "s/preboot\: false/preboot\: true/g" /root/src/environments/environment.ts 127 | 128 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6:/root intel/qat-crypto-base:qatsw-ubuntu \ 129 | export LANG=pt_BR.UTF-8 && \ 130 | sed -i -E "s/Banner do projeto/${REPOSITORY_NAME}/g" /root/src/themes/dspace/app/home-page/home-news/home-news.component.html 131 | 132 | docker run --rm -v $(pwd)/source/dspace-angular-dspace-7.6:/root intel/qat-crypto-base:qatsw-ubuntu \ 133 | export LANG=pt_BR.UTF-8 && \ 134 | sed -i -E "s/Descrição do banner/${REPOSITORY_DESCRIPTION}/g" /root/src/themes/dspace/app/home-page/home-news/home-news.component.html 135 | 136 | } >>./execution.log 2>&1 137 | 138 | printf ' 139 | -------------------------------------- 140 | \U0001F185 \t \U00023F3 141 | -------------------------------------- 142 | \e[1mPT_BR\e[0m: Inicializa o DSpace frontend. Esta operação demora. 143 | \e[1mEN\e[0m: Initializes the DSpace frontend. This operation takes a while. 144 | ' 145 | 146 | { 147 | echo "Setting up DSpace angular" 148 | docker compose -f source/dspace-angular-dspace-7.6/docker/docker-compose.yml up --build -d 149 | } >>./execution.log 2>&1 150 | 151 | 152 | 153 | timeout 1000s grep -q 'Compiled successfully.' <(docker logs dspace7-angular --follow) 154 | 155 | printf ' 156 | -------------------------------------- 157 | \U0001F186 \t \U0001F680 \U0001F389 158 | -------------------------------------- 159 | \e[1mPT_BR\e[0m: O frontend foi inicializado! Os endereços do DSpace deverão estar disponíveis nos endereços informados no arquivo "upgrade-variables.properties". 160 | \e[1mEN\e[0m: The DSpace frontend is ready! The access URLs will be the ones registered in the file "upgrade-variables.properties". 161 | ' 162 | 163 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # DSpace upgrade tool (versions 4, 5, 6) to DSpace 7 2 | (Ability to upgrade to DSpace 8 is in progress) 3 | # Notice: 4 | - Commercial use is not allowed 5 | 6 | Autor: Márcio Gurgel (marcio.rga@gmail.com) 7 | 8 | 9 | # EN (Portuguse bellow) 10 | 11 | # About 12 | This tool upgrades any DSpace 4, 5 or 6 to the latest DSpace 7.6, with (much) less need of human intervention. 13 | 14 | To use this tool, all you need is: a docker environment, a copy of "dspace-dir" form the old DSpace, a postgres dump from old DSpace; 15 | 16 | ## Key points 17 | 18 | - Upgrades the old submisison forms (xml) to the new DSpace 7 format; 19 | - **Imports the Solr statistics from the old DSpace to DSpace 7**; 20 | - Upgrades the DSpace's database strcuture to the latest version; 21 | - **This tool does not require your server to have dspace's stack programs**, such as: java, ant, maven, postgres, tomcat, solr, etc. The only required program is "docker" 22 | 23 | ## Pre requisites 24 | 25 | - Have a linux S.O.; 26 | - Download this project to your machine/server; 27 | - Install the commands `docker` and `docker compose` in the server which will receive the new DSpace 7. We highly recomend to use a new server for DSpace 7; 28 | - Make sure you have at least 3x more space in disk than the space used by the old DSpace; 29 | - Make sure you have at least 8GB of RAM; 30 | 31 | 32 | ## Procedure upgrade to DSpace 7 33 | 34 | - Generate a dump from the old DSpace database, using the command `pg_dump`. The generated dump, must have the name `dump.sql` and must be pasted in the directory `dump-postgres`; 35 | - Example of command: 36 | ```sql 37 | pg_dump --dbname=postgresql://dspace:dspace@192.169.5.126:5005/dspace > dump.sql 38 | ``` 39 | - Copy the DSPACE_DIR from the old DSpace to any locaiton in the new DSpace; 40 | - Copy and paste the file `upgrade-variables.properties.EXAMPLE` to `upgrade-variables.properties`; 41 | - Fullfill the variables in `upgrade-variables.properties` ; 42 | > [!IMPORTANT] 43 | > This file has some tips which can help to fill in the variables. 44 | > If you already have an DSpace 7 git repo, you can inform it in this file. Instead of downloading the original zip, this tool will clone your repo; 45 | 46 | 47 | - Add extra configuration to the file `[DSPACE_UPGRADE_TOOL]/local.cfg`, as email credentials, and so on; 48 | - As root user, run the script: 49 | ```shell 50 | ./upgrade-to-dspace7.sh 51 | ``` 52 | 53 | > [!IMPORTANT] 54 | > If there's any problem during the installation (eg: forgot to fullfill any variable) you can run this script again. As many times you need; 55 | > 56 | > The log file [project-root]/execution.log will be written with details of the upgrading process. 57 | 58 | 59 | 60 | ## Once you have upgraded to DSpace 7, using this tool: 61 | 62 | ### Making changes in DSpace 7 63 | 64 | ### Front-end (angular) 65 | - If you've set a git repo for your angular interface, this tool will `pull` the new code and re-compile the source in `[DSPACE_UPGRADE_TOOL]/source/dspace-angular-dspace-7.6`; 66 | - If you haven't set a git repo for your angular interface this tool will just recompile the source in `[DSPACE_UPGRADE_TOOL]/source/dspace-angular-dspace-7.6`; 67 | - Tô recompile your angular interface, just run `./restart-frontend.sh` 68 | 69 | ### Backend 70 | - To apply changes made in the "DSpace dir" (`[DSPACE_UPGRADE_TOOL]/dspace-install-dir`) run `./restart-backend.sh` 71 | 72 | 73 | All logs will by written in: `[DSPACE_UPGRADE_TOOL]/execution.log` 74 | 75 | 76 | ## Additional informations about the new DSpace instalation 77 | 78 | - The new "DSpace DIR" will be: `[DSPACE_UPGRADE_TOOL]/dspace-install-dir`, consider it for backup; 79 | - Backup the database using the following command (fullfill DEST_DIR): ```docker exec -t dspace7db pg_dump -c -U postgres dspace > [DEST_DIR]/dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql``` 80 | 81 | ## Commum issues 82 | 83 | ### Error 500 in angular interface 84 | - Verify if you are accessing the interface by the same address you've registered in `[DSPACE_UPGRADE_TOOL]/upgrade-variables.properties`; 85 | - Verify if the address shown by the command `docker exec -it dspace7 cat /dspace/config/local.cfg | grep dspace.ui.url` is the same registred in `[DSPACE_UPGRADE_TOOL]/upgrade-variables.properties`. If not, correct the variables and run again the script `./upgrade-to-dspace7.sh` again. 86 | ### White screen 87 | - Verify if the provided address of IP and Port are accessible from browser 88 | 89 | 90 | 91 | # PT_BR 92 | 93 | # Sobre 94 | Esta ferramenta instala um novo DSpace 7 ou atualiza qualquer DSpace nas versões 4, 5 ou 6 para a versão 7.6 com pouca necessidade de intervenção humana. 95 | 96 | ## O que a ferramenta faz? 97 | 98 | ### Em caso de criação de um novo DSpace 7 99 | - Cria instalação padrão IBICT do DSpace 7 100 | 101 | ### Em caso de atualização do DSpace 102 | - Atualiza os formulários de submissão para o novo formato do DSpace 7; 103 | - Importa as estatísticas de uso do Solr da instalação antiga para a instalação nova; 104 | - Atualiza banco de dados para a versão 7; 105 | - Cria e incializa os serviços: banco de dados, dspace server, dspace angular e PostgreSQL; 106 | 107 | ## Procedimentos 108 | 109 | ### Para instalar um novo DSpace 110 | - Instale os comandos "docker" e "docker compose" no seu servidor; 111 | - Copie e cole o arquivo `[DSPACE_UPGRADE_TOOL]/ibict_upgrade-variables.properties.EXAMPLE` para `[DSPACE_UPGRADE_TOOL]/ibict_upgrade-variables.properties`; 112 | - Preencha o arquivo `[DSPACE_UPGRADE_TOOL]/ibict_upgrade-variables.properties` . 113 | - Adicione configurações adicionais no arquivo `local.cfg`, como informações para envio de e-mail, etc. 114 | - Rode o script `./create-dspace7.sh` 115 | - Caso ocorra algum problema com o preenchimento das variáveis, efetue a correção e rode o script novamente. 116 | - Aguarde o processamento, o tempo de processamento irá depender do desempenho do servidor, ao final você será soliciado a criar um novo usuário; 117 | - Acesse a interface do DSpace utilizando os endereços inseridos no arquivo `[DSPACE_UPGRADE_TOOL]/ibict_upgrade-variables.properties`. 118 | 119 | 120 | 121 | ### Para atualizar um DSpace antigo para versão 7 122 | 123 | - Instale os comandos "docker" e "docker compose" no seu servidor; 124 | - Gere um dump do banco de dados (PostgreSQL) com o comando `pg_dump`. O nome do arquivo deve ser `dump.sql` e deve ser colocado no diretório `dump-postgres`; 125 | - Comando de exemplo para geração do dump: 126 | `pg_dump --dbname=postgresql://dspace:dspace@192.169.5.126:5005/dspace > dump.sql` 127 | - Copie o diretório de instalação do DSpace antigo para o servidor onde o DSpace 7 irá rodar. Os diretórios obrigatórios são: config, assetstore, webapps e solr. 128 | - Copie o arquivo `[DSPACE_UPGRADE_TOOL]/upgrade-variables.properties.EXAMPLE` para [DSPACE_UPGRADE_TOOL]/upgrade-variables.properties. 129 | - Preencha o arquivo `[DSPACE_UPGRADE_TOOL]/upgrade-variables.properties` . 130 | - Caso você já possua um repositório GIT com seu DSpace 7.6, informe o endereço neste arquivo, a ferramenta irá fazer o clone ao invés de fazer download do zip do repositório do DSpace original. 131 | - Adicione configurações adicionais no arquivo `local.cfg`, como informações para envio de e-mail, etc. 132 | - Com o usuário root, rode o script `upgrade-to-dspace7.sh` 133 | - Caso ocorra algum problema com o preenchimento das variáveis, efetue a correção e rode o script novamente. 134 | 135 | - Aguarde o processamento, o tempo de processamento irá depender do desempenho do servidor; 136 | - Acesse a interface do DSpace utilizando os endereços inseridos no arquivo `[DSPACE_UPGRADE_TOOL]/upgrade-variables.properties`. 137 | 138 | 139 | 140 | ## Procedimento para aplicar mudanças no DSpace 7 141 | 142 | ### Front-end (angular) 143 | - Caso você tenha especificado um repositório git para sua interface angular, no arquivo `upgrade-variables.properties` esta ferramenta fará o `pull` do novo código e recompilar o código-fonte localizado em: `[DSPACE_UPGRADE_TOOL]/source/dspace-angular-dspace-7.6`; 144 | - Caso você não tenha informado um repositório Git, esta ferramenta irá apenar recompilar o código presente em: `[DSPACE_UPGRADE_TOOL]/source/dspace-angular-dspace-7.6`; 145 | - Para recompilar a interface, execute: `./restart-frontend.sh` 146 | 147 | ### Backend 148 | - Para aplicar mudanças feitas no diretório de instalação, (`[DSPACE_UPGRADE_TOOL]/dspace-install-dir`) execute `./restart-backend.sh` 149 | 150 | 151 | ### Todos logs serão escritos em: `[DSPACE_UPGRADE_TOOL]/execution.log` 152 | 153 | ## Informações adicionais sobre a instalação 154 | 155 | - O diretório de instalação do DSpace será [DSPACE_UPGRADE_TOOL]/dspace-install-dir, considere esta pasta para backup; 156 | - O banco de dados pode receber backup pelo comando: ```docker exec -t dspace7db pg_dump -c -U postgres dspace > [DEST_DIR]/dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql``` 157 | 158 | ## Problemas comuns 159 | 160 | ### Erro 500 na tela 161 | - Verifique se está acessando o DSpace pelo endereço cadastrado no arquivo `[DSPACE_UPGRADE_TOOL]/upgrade-variables.properties` 162 | - Verifique se o endereço retornado pelo comando `docker exec -it dspace7 cat /dspace/config/local.cfg | grep dspace.ui.url` confere com o cadastrado no arquivo `[DSPACE_UPGRADE_TOOL]/upgrade-variables.properties`. Caso negativo, refaça a migração com os valores corretos. Isso pode acontecer caso você tenha feito o "backend" apontando para um endereço e o "frontend" apontando para outro endereço. 163 | 164 | 165 | ### Tela branca 166 | - Verifique se os endereços IP/Porta fornecidos no arquivo `[DSPACE_UPGRADE_TOOL]/upgrade-variables.properties` estão acessíveis. 167 | 168 | - 169 | --- 170 | 171 | -------------------------------------------------------------------------------- /backend_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | { 4 | 5 | if ! [[ $1 ]]; then 6 | source ./upgrade-variables.properties 7 | else 8 | source ./ibict_upgrade-variables.properties 9 | source ./_default_instalation_variables.properties 10 | fi 11 | 12 | docker pull intel/qat-crypto-base:qatsw-ubuntu 13 | docker pull kubeless/unzip 14 | docker pull alpine/git 15 | } >>./execution.log 2>&1 16 | 17 | printf ' 18 | -------------------------------------- 19 | \U0001F171 20 | -------------------------------------- 21 | \e[1mPT_BR\e[0m: Gerando uma nova senha do PostgreSQL para esta nova instalação. Você poderá encontrar a nova senha no arquivo localizado em "dspace-install-dir/config/local.cfg" 22 | \e[1mEN\e[0m: Generating a new PostgreSQL password for this installation. You will be able to find this new password in "dspace-install-dir/config/local.cfg" 23 | ' 24 | { 25 | export DSPACE_POSTGRES_PASSWORD=$(docker run --rm intel/qat-crypto-base:qatsw-ubuntu openssl rand -base64 12 | sed -e "s/\///g") 26 | } >>./execution.log 2>&1 27 | 28 | printf ' 29 | -------------------------------------- 30 | \U0001F172 31 | -------------------------------------- 32 | \e[1mPT_BR\e[0m: Copiando os arquivos do diretório de instalação do DSpace 33 | \e[1mEN\e[0m: Copying the files from the DSpace installation 34 | ' 35 | 36 | { 37 | cp -r $DSPACE_INSTALL_DIR/config dspace-install-dir 38 | cp -r $DSPACE_INSTALL_DIR/solr dspace-install-dir 39 | cp -r $DSPACE_INSTALL_DIR/assetstore dspace-install-dir 40 | cp -r $DSPACE_INSTALL_DIR/webapps dspace-install-dir 41 | } >>./execution.log 2>&1 42 | 43 | if [[ "${BACKEND_ADDRESS_GIT}" ]]; then 44 | 45 | printf ' 46 | -------------------------------------- 47 | \U0001F173 48 | -------------------------------------- 49 | \e[1mPT_BR\e[0m: Backend: Clonando o repositório GIT especificado como fonte para o DSpace 7.6 50 | \e[1mEN\e[0m: Backend: Cloning the GIT repo specified as DSpace 7.6 source 51 | ' 52 | { 53 | docker run --rm -e BACKEND_ADDRESS_GIT:${BACKEND_ADDRESS_GIT} -v $(pwd):/git -w /git alpine/git && 54 | git clone --depth 1 ${BACKEND_ADDRESS_GIT} DSpace-dspace-7.6 55 | } >>./execution.log 2>&1 56 | else 57 | 58 | printf ' 59 | -------------------------------------- 60 | \U0001F173 61 | -------------------------------------- 62 | \e[1mPT_BR\e[0m Backend: Efetuando o download do fonte do DSpace 7.6 do GitHub do DSpace 63 | \e[1mEN\e[0m: Backend: Downloading the source of DSpace 7.6 from DSpace Github 64 | ' 65 | { 66 | docker run --rm -v $(pwd):/unzip -w /unzip kubeless/unzip && \ 67 | curl https://github.com/DSpace/DSpace/archive/refs/tags/dspace-7.6.zip -o dspace-7.6.zip -L && \ 68 | unzip -q dspace-7.6.zip && \ 69 | sleep 1 && \ 70 | rm dspace-7.6.zip && \ 71 | sleep 1 && \ 72 | rm -rf dspace-7.6 73 | } >>./execution.log 2>&1 74 | fi 75 | 76 | printf ' 77 | -------------------------------------- 78 | \U0001F174 79 | -------------------------------------- 80 | \e[1mPT_BR\e[0m: Backend: Efetuando substituição de variáveis nos arquivos de deployment do DSpace. 81 | \e[1mEN\e[0m: Backend: Filling the variables in the deployment files. 82 | ' 83 | 84 | { 85 | mkdir source || true >/dev/null 2>&1 86 | mv DSpace-dspace-7.6 source 87 | 88 | cp ./dockerfiles/Dockerfile_backend source/DSpace-dspace-7.6/Dockerfile 89 | cp ./dockerfiles/docker-compose_migration.yml source/DSpace-dspace-7.6/ 90 | cp ./dockerfiles/docker-compose_restart.yml source/DSpace-dspace-7.6/ 91 | 92 | docker run --rm -v $(pwd)/source:/root -w /root intel/qat-crypto-base:qatsw-ubuntu \ 93 | sed -i -E "s/published\: (.*) \#Port for tomcat/published\: ${BACKEND_PORT} \#Port for tomcat/g" /root/DSpace-dspace-7.6/docker-compose_migration.yml 94 | docker run --rm -v $(pwd)/source:/root -w /root intel/qat-crypto-base:qatsw-ubuntu \ 95 | sed -i -E "s/published\: (.*) \#Port for tomcat/published\: ${BACKEND_PORT} \#Port for tomcat/g" /root/DSpace-dspace-7.6/docker-compose_restart.yml 96 | 97 | docker run --rm -e DSPACE_POSTGRES_PASSWORD:${DSPACE_POSTGRES_PASSWORD} -v $(pwd)/source:/root intel/qat-crypto-base:qatsw-ubuntu sed -i -E "s/POSTGRES_PASSWORD=(.*) #Postgres password/POSTGRES_PASSWORD=${DSPACE_POSTGRES_PASSWORD} #Postgres password/g" /root/DSpace-dspace-7.6/docker-compose_migration.yml 98 | docker run --rm -e DSPACE_POSTGRES_PASSWORD:${DSPACE_POSTGRES_PASSWORD} -v $(pwd)/source:/root intel/qat-crypto-base:qatsw-ubuntu sed -i -E "s/POSTGRES_PASSWORD=(.*) #Postgres password/POSTGRES_PASSWORD=${DSPACE_POSTGRES_PASSWORD} #Postgres password/g" /root/DSpace-dspace-7.6/docker-compose_restart.yml 99 | 100 | cp -r ./dockerfiles/docker/postgres ./source 101 | 102 | if ! [[ $1 ]]; then 103 | 104 | cp ./dump-postgres/dump.sql ./source/postgres 105 | 106 | fi 107 | 108 | docker run --rm -e DSPACE_POSTGRES_PASSWORD:${DSPACE_POSTGRES_PASSWORD} -v $(pwd)/source:/root -w /root intel/qat-crypto-base:qatsw-ubuntu \ 109 | sed -i -E "s/CREATE USER dspace WITH PASSWORD '(.*)'/CREATE USER dspace WITH PASSWORD '${DSPACE_POSTGRES_PASSWORD}'/g" /root/postgres/scripts/prepara-postgres.sh 110 | 111 | echo "" >source/DSpace-dspace-7.6/dspace/config/local.cfg 112 | cat ./local.cfg >source/DSpace-dspace-7.6/dspace/config/local.cfg 113 | echo "db.password = ${DSPACE_POSTGRES_PASSWORD}" >>source/DSpace-dspace-7.6/dspace/config/local.cfg 114 | echo "db.url = jdbc:postgresql://dspace7db.dspacenet:5432/dspace" >>source/DSpace-dspace-7.6/dspace/config/local.cfg 115 | 116 | if [ -n "$REVERSE_PROXY_BACKEND_PROTOCOL" ] || [ -n "$REVERSE_PROXY_BACKEND_HOSTNAME" ] || [ -n "$REVERSE_PROXY_BACKEND_PORT" ]; then 117 | if [ -n "$REVERSE_PROXY_BACKEND_PORT" ]; then 118 | echo "dspace.server.url = ${REVERSE_PROXY_BACKEND_PROTOCOL}://${REVERSE_PROXY_BACKEND_HOSTNAME}:${REVERSE_PROXY_BACKEND_PORT}" >>source/DSpace-dspace-7.6/dspace/config/local.cfg 119 | else 120 | echo "dspace.server.url = ${REVERSE_PROXY_BACKEND_PROTOCOL}://${REVERSE_PROXY_BACKEND_HOSTNAME}" >>source/DSpace-dspace-7.6/dspace/config/local.cfg 121 | fi 122 | else 123 | echo "dspace.server.url = ${BACKEND_PROTOCOL}://${BACKEND_HOSTNAME}:${BACKEND_PORT}/server" >>source/DSpace-dspace-7.6/dspace/config/local.cfg 124 | fi 125 | 126 | if [ -n "$REVERSE_PROXY_FRONTEND_PROTOCOL" ] || [ -n "$REVERSE_PROXY_FRONTEND_HOSTNAME" ] || [ -n "$REVERSE_PROXY_FRONTEND_PORT" ]; then 127 | if [ -n "$REVERSE_PROXY_FRONTEND_PORT" ]; then 128 | echo "dspace.ui.url = ${REVERSE_PROXY_FRONTEND_PROTOCOL}://${REVERSE_PROXY_FRONTEND_HOSTNAME}:${REVERSE_PROXY_FRONTEND_PORT}" >>source/DSpace-dspace-7.6/dspace/config/local.cfg 129 | else 130 | echo "dspace.ui.url = ${REVERSE_PROXY_FRONTEND_PROTOCOL}://${REVERSE_PROXY_FRONTEND_HOSTNAME}" >>source/DSpace-dspace-7.6/dspace/config/local.cfg 131 | fi 132 | else 133 | echo "dspace.ui.url = ${FRONTEND_PROTOCOL}://${FRONTEND_HOSTNAME}:${FRONTEND_PORT}" >>source/DSpace-dspace-7.6/dspace/config/local.cfg 134 | fi 135 | } >>./execution.log 2>&1 136 | 137 | if ! [[ $1 ]]; then 138 | printf ' 139 | -------------------------------------- 140 | \U0001F175 \t \U0001F4C8 \t \U00023F3 141 | -------------------------------------- 142 | \e[1mPT_BR\e[0m: Gerando backup das estatísticas de acesso do Solr antigo. Esta operação pode demorar. 143 | \e[1mEN\e[0m: Generating the backup of old Solr statistics. This opperation might take a while. 144 | ' 145 | source ./migrate-solr.sh 146 | fi 147 | 148 | printf ' 149 | -------------------------------------- 150 | \U0001F176 \t \U0001F528 \t \U00023F3 151 | -------------------------------------- 152 | \e[1mPT_BR\e[0m: Compila o DSpace e gera o novo diretório de instalação. Esta operação pode demorar. 153 | \e[1mEN\e[0m: Compile the DSpace source and generates the new installation directory. This opperation might take a while. 154 | ' 155 | 156 | { 157 | if ! [[ $1 ]]; then 158 | rm -rf ./dspace-install-dir/config/spring 159 | cp -r ./source/DSpace-dspace-7.6/dspace/config/spring ./dspace-install-dir/config/ 160 | fi 161 | # Maven 162 | mkdir ~/.m2 || true 163 | docker run -v ~/.m2:/var/maven/.m2 -v "$(pwd)/source/DSpace-dspace-7.6":/tmp/dspacebuild -w /tmp/dspacebuild -ti --rm -e MAVen_CONFIG=/var/maven/.m2 maven:3.8.6-openjdk-11 mvn -q --no-transfer-progress -Duser.home=/var/maven clean package -P dspace-oai,\!dspace-sword,\!dspace-swordv2,\!dspace-rdf,\!dspace-iiif 164 | 165 | # Ant 166 | docker run -v ~/.m2:/var/maven/.m2 -v $(pwd)/dspace-install-dir:/dspace -v $(pwd)/source/DSpace-dspace-7.6:/tmp/dspacebuild -w /tmp/dspacebuild -ti --rm -e MAVen_CONFIG=/var/maven/.m2 maven:3.8.6-openjdk-11 /bin/bash -c "wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.12-bin.tar.gz && tar -xvzf apache-ant-1.10.12-bin.tar.gz && cd dspace/target/dspace-installer && ../../../apache-ant-1.10.12/bin/ant init_installation update_configs update_code update_webapps && cd ../../../ && rm -rf apache-ant-*" 167 | 168 | if [[ $1 ]]; then 169 | ls -lsah $DSPACE_INSTALL_DIR/config 170 | cp -r $DSPACE_INSTALL_DIR/config dspace-install-dir 171 | fi 172 | 173 | } >>./execution.log 2>&1 174 | 175 | printf ' 176 | -------------------------------------- 177 | \U0001F177 178 | -------------------------------------- 179 | \e[1mPT_BR\e[0m: Inicializa o DSpace server 180 | \e[1mEN\e[0m: Initializes the DSpace sever 181 | ' 182 | 183 | { 184 | if ! [[ $1 ]]; then 185 | docker compose -f source/DSpace-dspace-7.6/docker-compose_migration.yml up --build -d 186 | else 187 | docker compose -f source/DSpace-dspace-7.6/docker-compose_restart.yml up --build -d 188 | fi 189 | 190 | sleep 10 191 | } >>./execution.log 2>&1 192 | 193 | 194 | if ! [[ $1 ]]; then 195 | 196 | printf ' 197 | -------------------------------------- 198 | \U0001F178 \t \U0001F4C8 \t \U00023F3 199 | -------------------------------------- 200 | \e[1mPT_BR\e[0m: Importa o backup do Solr gerado anteriormente para a nova instância do Solr. Esta operação pode demorar. 201 | \e[1mEN\e[0m: Imports the previous generated Solr dump to the new instance of Solr. This opperation might take a while. 202 | ' 203 | 204 | { 205 | for file in ./tmp/solr_*; do 206 | echo "Sending file ${file##*/} to Solr..." 207 | docker run --rm --network="dspacenet" -e file=${file} -v $(pwd):/unzip -w /unzip kubeless/unzip curl 'http://dspace7solr:8983/solr/statistics/update?commit=true&commitWithin=1000' --data-binary @"${file}" -H 'Content-type:application/csv' 208 | done 209 | 210 | sudo rm -rf ./tmp/* 211 | docker rm -f tomcatsolr || true 212 | } >>./execution.log 2>&1 213 | 214 | fi 215 | printf ' 216 | -------------------------------------- 217 | \U0001F179 \t \U0001F680 \U0001F389 218 | -------------------------------------- 219 | \e[1mPT_BR\e[0m: O backend do DSpace está pronto! Os endereços do DSpace deverão estar disponíveis nos endereços informados no arquivo de variáveis. 220 | \e[1mEN\e[0m: The DSpace backend is ready! The access URLs will be the ones registered in the variables files. 221 | ' 222 | -------------------------------------------------------------------------------- /license.md: -------------------------------------------------------------------------------- 1 | Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 2 | International 3 | 4 | Creative Commons Corporation ("Creative Commons") is not a law firm and 5 | does not provide legal services or legal advice. Distribution of 6 | Creative Commons public licenses does not create a lawyer-client or 7 | other relationship. Creative Commons makes its licenses and related 8 | information available on an "as-is" basis. Creative Commons gives no 9 | warranties regarding its licenses, any material licensed under their 10 | terms and conditions, or any related information. Creative Commons 11 | disclaims all liability for damages resulting from their use to the 12 | fullest extent possible. 13 | 14 | Using Creative Commons Public Licenses 15 | 16 | Creative Commons public licenses provide a standard set of terms and 17 | conditions that creators and other rights holders may use to share 18 | original works of authorship and other material subject to copyright and 19 | certain other rights specified in the public license below. The 20 | following considerations are for informational purposes only, are not 21 | exhaustive, and do not form part of our licenses. 22 | 23 | Considerations for licensors: Our public licenses are intended for use 24 | by those authorized to give the public permission to use material in 25 | ways otherwise restricted by copyright and certain other rights. Our 26 | licenses are irrevocable. Licensors should read and understand the terms 27 | and conditions of the license they choose before applying it. Licensors 28 | should also secure all rights necessary before applying our licenses so 29 | that the public can reuse the material as expected. Licensors should 30 | clearly mark any material not subject to the license. This includes 31 | other CC-licensed material, or material used under an exception or 32 | limitation to copyright. More considerations for licensors : 33 | wiki.creativecommons.org/Considerations\_for\_licensors 34 | 35 | Considerations for the public: By using one of our public licenses, a 36 | licensor grants the public permission to use the licensed material under 37 | specified terms and conditions. If the licensor's permission is not 38 | necessary for any reason–for example, because of any applicable 39 | exception or limitation to copyright–then that use is not regulated by 40 | the license. Our licenses grant only permissions under copyright and 41 | certain other rights that a licensor has authority to grant. Use of the 42 | licensed material may still be restricted for other reasons, including 43 | because others have copyright or other rights in the material. A 44 | licensor may make special requests, such as asking that all changes be 45 | marked or described. Although not required by our licenses, you are 46 | encouraged to respect those requests where reasonable. More 47 | considerations for the public : 48 | wiki.creativecommons.org/Considerations\_for\_licensees 49 | 50 | Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 51 | International Public License 52 | 53 | By exercising the Licensed Rights (defined below), You accept and agree 54 | to be bound by the terms and conditions of this Creative Commons 55 | Attribution-NonCommercial-NoDerivatives 4.0 International Public License 56 | ("Public License"). To the extent this Public License may be interpreted 57 | as a contract, You are granted the Licensed Rights in consideration of 58 | Your acceptance of these terms and conditions, and the Licensor grants 59 | You such rights in consideration of benefits the Licensor receives from 60 | making the Licensed Material available under these terms and conditions. 61 | 62 | - Section 1 – Definitions. 63 | 64 | - a. Adapted Material means material subject to Copyright and 65 | Similar Rights that is derived from or based upon the Licensed 66 | Material and in which the Licensed Material is translated, 67 | altered, arranged, transformed, or otherwise modified in a 68 | manner requiring permission under the Copyright and Similar 69 | Rights held by the Licensor. For purposes of this Public 70 | License, where the Licensed Material is a musical work, 71 | performance, or sound recording, Adapted Material is always 72 | produced where the Licensed Material is synched in timed 73 | relation with a moving image. 74 | - b. Copyright and Similar Rights means copyright and/or similar 75 | rights closely related to copyright including, without 76 | limitation, performance, broadcast, sound recording, and Sui 77 | Generis Database Rights, without regard to how the rights are 78 | labeled or categorized. For purposes of this Public License, the 79 | rights specified in Section 2(b)(1)-(2) are not Copyright and 80 | Similar Rights. 81 | - c. Effective Technological Measures means those measures that, 82 | in the absence of proper authority, may not be circumvented 83 | under laws fulfilling obligations under Article 11 of the WIPO 84 | Copyright Treaty adopted on December 20, 1996, and/or similar 85 | international agreements. 86 | - d. Exceptions and Limitations means fair use, fair dealing, 87 | and/or any other exception or limitation to Copyright and 88 | Similar Rights that applies to Your use of the Licensed 89 | Material. 90 | - e. Licensed Material means the artistic or literary work, 91 | database, or other material to which the Licensor applied this 92 | Public License. 93 | - f. Licensed Rights means the rights granted to You subject to 94 | the terms and conditions of this Public License, which are 95 | limited to all Copyright and Similar Rights that apply to Your 96 | use of the Licensed Material and that the Licensor has authority 97 | to license. 98 | - g. Licensor means the individual(s) or entity(ies) granting 99 | rights under this Public License. 100 | - h. NonCommercial means not primarily intended for or directed 101 | towards commercial advantage or monetary compensation. For 102 | purposes of this Public License, the exchange of the Licensed 103 | Material for other material subject to Copyright and Similar 104 | Rights by digital file-sharing or similar means is NonCommercial 105 | provided there is no payment of monetary compensation in 106 | connection with the exchange. 107 | - i. Share means to provide material to the public by any means or 108 | process that requires permission under the Licensed Rights, such 109 | as reproduction, public display, public performance, 110 | distribution, dissemination, communication, or importation, and 111 | to make material available to the public including in ways that 112 | members of the public may access the material from a place and 113 | at a time individually chosen by them. 114 | - j. Sui Generis Database Rights means rights other than copyright 115 | resulting from Directive 96/9/EC of the European Parliament and 116 | of the Council of 11 March 1996 on the legal protection of 117 | databases, as amended and/or succeeded, as well as other 118 | essentially equivalent rights anywhere in the world. 119 | - k. You means the individual or entity exercising the Licensed 120 | Rights under this Public License. Your has a corresponding 121 | meaning. 122 | 123 | - Section 2 – Scope. 124 | 125 | - a. License grant. 126 | - 1. Subject to the terms and conditions of this Public 127 | License, the Licensor hereby grants You a worldwide, 128 | royalty-free, non-sublicensable, non-exclusive, irrevocable 129 | license to exercise the Licensed Rights in the Licensed 130 | Material to: 131 | - A. reproduce and Share the Licensed Material, in whole 132 | or in part, for NonCommercial purposes only; and 133 | - B. produce and reproduce, but not Share, Adapted 134 | Material for NonCommercial purposes only. 135 | - 2. Exceptions and Limitations. For the avoidance of doubt, 136 | where Exceptions and Limitations apply to Your use, this 137 | Public License does not apply, and You do not need to comply 138 | with its terms and conditions. 139 | - 3. Term. The term of this Public License is specified in 140 | Section 6(a). 141 | - 4. Media and formats; technical modifications allowed. The 142 | Licensor authorizes You to exercise the Licensed Rights in 143 | all media and formats whether now known or hereafter 144 | created, and to make technical modifications necessary to do 145 | so. The Licensor waives and/or agrees not to assert any 146 | right or authority to forbid You from making technical 147 | modifications necessary to exercise the Licensed Rights, 148 | including technical modifications necessary to circumvent 149 | Effective Technological Measures. For purposes of this 150 | Public License, simply making modifications authorized by 151 | this Section 2(a)(4) never produces Adapted Material. 152 | - 5. Downstream recipients. 153 | - A. Offer from the Licensor – Licensed Material. Every 154 | recipient of the Licensed Material automatically 155 | receives an offer from the Licensor to exercise the 156 | Licensed Rights under the terms and conditions of this 157 | Public License. 158 | - B. No downstream restrictions. You may not offer or 159 | impose any additional or different terms or conditions 160 | on, or apply any Effective Technological Measures to, 161 | the Licensed Material if doing so restricts exercise of 162 | the Licensed Rights by any recipient of the Licensed 163 | Material. 164 | - 6. No endorsement. Nothing in this Public License 165 | constitutes or may be construed as permission to assert or 166 | imply that You are, or that Your use of the Licensed 167 | Material is, connected with, or sponsored, endorsed, or 168 | granted official status by, the Licensor or others 169 | designated to receive attribution as provided in Section 170 | 3(a)(1)(A)(i). 171 | - b. Other rights. 172 | - 1. Moral rights, such as the right of integrity, are not 173 | licensed under this Public License, nor are publicity, 174 | privacy, and/or other similar personality rights; however, 175 | to the extent possible, the Licensor waives and/or agrees 176 | not to assert any such rights held by the Licensor to the 177 | limited extent necessary to allow You to exercise the 178 | Licensed Rights, but not otherwise. 179 | - 2. Patent and trademark rights are not licensed under this 180 | Public License. 181 | - 3. To the extent possible, the Licensor waives any right to 182 | collect royalties from You for the exercise of the Licensed 183 | Rights, whether directly or through a collecting society 184 | under any voluntary or waivable statutory or compulsory 185 | licensing scheme. In all other cases the Licensor expressly 186 | reserves any right to collect such royalties, including when 187 | the Licensed Material is used other than for NonCommercial 188 | purposes. 189 | 190 | - Section 3 – License Conditions. 191 | 192 | Your exercise of the Licensed Rights is expressly made subject to 193 | the following conditions. 194 | 195 | - a. Attribution. 196 | - 1. If You Share the Licensed Material, You must: 197 | 198 | - A. retain the following if it is supplied by the 199 | Licensor with the Licensed Material: 200 | - i. identification of the creator(s) of the Licensed 201 | Material and any others designated to receive 202 | attribution, in any reasonable manner requested by 203 | the Licensor (including by pseudonym if designated); 204 | - ii. a copyright notice; 205 | - iii. a notice that refers to this Public License; 206 | - iv. a notice that refers to the disclaimer of 207 | warranties; 208 | - v. a URI or hyperlink to the Licensed Material to 209 | the extent reasonably practicable; 210 | - B. indicate if You modified the Licensed Material and 211 | retain an indication of any previous modifications; and 212 | - C. indicate the Licensed Material is licensed under this 213 | Public License, and include the text of, or the URI or 214 | hyperlink to, this Public License. 215 | 216 | For the avoidance of doubt, You do not have permission under 217 | this Public License to Share Adapted Material. 218 | 219 | - 2. You may satisfy the conditions in Section 3(a)(1) in any 220 | reasonable manner based on the medium, means, and context in 221 | which You Share the Licensed Material. For example, it may 222 | be reasonable to satisfy the conditions by providing a URI 223 | or hyperlink to a resource that includes the required 224 | information. 225 | - 3. If requested by the Licensor, You must remove any of the 226 | information required by Section 3(a)(1)(A) to the extent 227 | reasonably practicable. 228 | 229 | - Section 4 – Sui Generis Database Rights. 230 | 231 | Where the Licensed Rights include Sui Generis Database Rights that 232 | apply to Your use of the Licensed Material: 233 | 234 | - a. for the avoidance of doubt, Section 2(a)(1) grants You the 235 | right to extract, reuse, reproduce, and Share all or a 236 | substantial portion of the contents of the database for 237 | NonCommercial purposes only and provided You do not Share 238 | Adapted Material; 239 | - b. if You include all or a substantial portion of the database 240 | contents in a database in which You have Sui Generis Database 241 | Rights, then the database in which You have Sui Generis Database 242 | Rights (but not its individual contents) is Adapted Material; 243 | and 244 | - c. You must comply with the conditions in Section 3(a) if You 245 | Share all or a substantial portion of the contents of the 246 | database. 247 | 248 | For the avoidance of doubt, this Section 4 supplements and does not 249 | replace Your obligations under this Public License where the 250 | Licensed Rights include other Copyright and Similar Rights. 251 | 252 | - Section 5 – Disclaimer of Warranties and Limitation of Liability. 253 | 254 | - a. Unless otherwise separately undertaken by the Licensor, to 255 | the extent possible, the Licensor offers the Licensed Material 256 | as-is and as-available, and makes no representations or 257 | warranties of any kind concerning the Licensed Material, whether 258 | express, implied, statutory, or other. This includes, without 259 | limitation, warranties of title, merchantability, fitness for a 260 | particular purpose, non-infringement, absence of latent or other 261 | defects, accuracy, or the presence or absence of errors, whether 262 | or not known or discoverable. Where disclaimers of warranties 263 | are not allowed in full or in part, this disclaimer may not 264 | apply to You. 265 | - b. To the extent possible, in no event will the Licensor be 266 | liable to You on any legal theory (including, without 267 | limitation, negligence) or otherwise for any direct, special, 268 | indirect, incidental, consequential, punitive, exemplary, or 269 | other losses, costs, expenses, or damages arising out of this 270 | Public License or use of the Licensed Material, even if the 271 | Licensor has been advised of the possibility of such losses, 272 | costs, expenses, or damages. Where a limitation of liability is 273 | not allowed in full or in part, this limitation may not apply to 274 | You. 275 | - c. The disclaimer of warranties and limitation of liability 276 | provided above shall be interpreted in a manner that, to the 277 | extent possible, most closely approximates an absolute 278 | disclaimer and waiver of all liability. 279 | 280 | - Section 6 – Term and Termination. 281 | 282 | - a. This Public License applies for the term of the Copyright and 283 | Similar Rights licensed here. However, if You fail to comply 284 | with this Public License, then Your rights under this Public 285 | License terminate automatically. 286 | - b. Where Your right to use the Licensed Material has terminated 287 | under Section 6(a), it reinstates: 288 | 289 | - 1. automatically as of the date the violation is cured, 290 | provided it is cured within 30 days of Your discovery of the 291 | violation; or 292 | - 2. upon express reinstatement by the Licensor. 293 | 294 | For the avoidance of doubt, this Section 6(b) does not affect 295 | any right the Licensor may have to seek remedies for Your 296 | violations of this Public License. 297 | 298 | - c. For the avoidance of doubt, the Licensor may also offer the 299 | Licensed Material under separate terms or conditions or stop 300 | distributing the Licensed Material at any time; however, doing 301 | so will not terminate this Public License. 302 | - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 303 | License. 304 | 305 | - Section 7 – Other Terms and Conditions. 306 | 307 | - a. The Licensor shall not be bound by any additional or 308 | different terms or conditions communicated by You unless 309 | expressly agreed. 310 | - b. Any arrangements, understandings, or agreements regarding the 311 | Licensed Material not stated herein are separate from and 312 | independent of the terms and conditions of this Public License. 313 | 314 | - Section 8 – Interpretation. 315 | 316 | - a. For the avoidance of doubt, this Public License does not, and 317 | shall not be interpreted to, reduce, limit, restrict, or impose 318 | conditions on any use of the Licensed Material that could 319 | lawfully be made without permission under this Public License. 320 | - b. To the extent possible, if any provision of this Public 321 | License is deemed unenforceable, it shall be automatically 322 | reformed to the minimum extent necessary to make it enforceable. 323 | If the provision cannot be reformed, it shall be severed from 324 | this Public License without affecting the enforceability of the 325 | remaining terms and conditions. 326 | - c. No term or condition of this Public License will be waived 327 | and no failure to comply consented to unless expressly agreed to 328 | by the Licensor. 329 | - d. Nothing in this Public License constitutes or may be 330 | interpreted as a limitation upon, or waiver of, any privileges 331 | and immunities that apply to the Licensor or You, including from 332 | the legal processes of any jurisdiction or authority. 333 | 334 | Creative Commons is not a party to its public licenses. Notwithstanding, 335 | Creative Commons may elect to apply one of its public licenses to 336 | material it publishes and in those instances will be considered the 337 | "Licensor." The text of the Creative Commons public licenses is 338 | dedicated to the public domain under the CC0 Public Domain Dedication. 339 | Except for the limited purpose of indicating that material is shared 340 | under a Creative Commons public license or as otherwise permitted by the 341 | Creative Commons policies published at creativecommons.org/policies, 342 | Creative Commons does not authorize the use of the trademark "Creative 343 | Commons" or any other trademark or logo of Creative Commons without its 344 | prior written consent including, without limitation, in connection with 345 | any unauthorized modifications to any of its public licenses or any 346 | other arrangements, understandings, or agreements concerning use of 347 | licensed material. For the avoidance of doubt, this paragraph does not 348 | form part of the public licenses. 349 | 350 | Creative Commons may be contacted at creativecommons.org. 351 | --------------------------------------------------------------------------------