dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
828 stars 464 forks source link

Doc: Add a command to init dotCMS with a custom database #28678

Closed nollymar closed 1 month ago

nollymar commented 3 months ago

Parent Issue

No response

Task

After the migration to Maven we lost the ability to deploy a dotCMS instance using a database dump. We should provide a procedure or command that make this process easy for our devs

Proposed Objective

Documentation

Proposed Priority

Priority 3 - Average

Acceptance Criteria

No response

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

dcolina commented 1 month ago

Note to QA:

In order to test the external database import the following configuration is required.

  dotcms:
    image: dotcms/dotcms:trunk
    environment:
        CMS_JAVA_OPTS: '-Xmx1g '
        LANG: 'C.UTF-8'
        TZ: 'UTC'
        DB_BASE_URL: "jdbc:postgresql://db/dotcms"
        DB_USERNAME: 'dotcmsdbuser'
        DB_PASSWORD: 'password'
        DB_NAME=dotcms
        DB_HOST=db
        DB_LOAD_DUMP_SQL=/data/dump/dump.sql #dump location inside the docker container
        DOT_ES_AUTH_BASIC_PASSWORD: 'admin'
        DOT_ES_ENDPOINTS: 'https://opensearch:9200'
        DOT_INITIAL_ADMIN_PASSWORD: 'admin'
        DOT_DOTCMS_CLUSTER_ID:  'dotcms-production'

    volumes:
      - type: bind
        source: /tmp/dump.sql  #dump location in host
        target: /data/dump/dump.sql #dump location inside the docker container
valentinogiardino commented 1 month ago

IQA PASSED Now its possible to init dotCMS with a custom database [image: dotcms/dotcms:trunk]

  dotcms:
    image: dotcms/dotcms:trunk
    environment:
        CMS_JAVA_OPTS: '-Xmx1g '
        LANG: 'C.UTF-8'
        TZ: 'UTC'
        DB_BASE_URL: "jdbc:postgresql://db/dotcms"
        DB_USERNAME: 'dotcmsdbuser'
        DB_PASSWORD: 'password'
        DB_NAME: 'dotcms'
        DB_HOST: 'db'
        DB_LOAD_DUMP_SQL: '/data/dump/dump.sql'
        DOT_ES_AUTH_BASIC_PASSWORD: 'admin'
        DOT_ES_ENDPOINTS: 'https://opensearch:9200'
        DOT_INITIAL_ADMIN_PASSWORD: 'admin'
        DOT_DOTCMS_CLUSTER_ID:  'dotcms-production'
    depends_on:
      - opensearch
      - db
    volumes:
      - cms-shared:/data/shared
      - ./dump-sql/dump.sql:/data/dump/dump.sql
      - ./license.zip:/data/shared/assets/license.zip
    networks:
      - db_net
      - opensearch-net
    ports:
      - "8080:8080"
      - "8443:8443"
Captura de pantalla 2024-07-09 a la(s) 15 09 20 Captura de pantalla 2024-07-09 a la(s) 15 07 53
josemejias11 commented 1 month ago

Approved: Tested on trunk_1c26ebf, Docker, macOS 14.5, FF v126.0.1

erickgonzalez commented 1 month ago

Only for 24.04 LTS