toolkit icon indicating copy to clipboard operation
toolkit copied to clipboard

How to migrate from a Docker Compose installation to a new Overleaf Toolkit instance?

Open HuengchI opened this issue 2 years ago • 1 comments

Hey folks, I am seeking suggestions on how to migrate from a legacy Docker Compose installation to a new Overleaf Toolkit instance. I have already attempted to copy the data directory, but the application is refusing to start due to an incompatible version of mongo.

Here is my docker-compose.yaml file:

version: '2.2'
services:
    sharelatex:
        restart: always
        # Server Pro users:
        # image: quay.io/sharelatex/sharelatex-pro
        image: sharelatex/sharelatex:3.1
        container_name: sharelatex
        depends_on:
            mongo:
                condition: service_healthy
            redis:
                condition: service_started
        ports:
            - 80:80
        links:
            - mongo
            - redis
        volumes:
            - /data/overleaf/sharelatex_data:/var/lib/sharelatex
            - /data/overleaf/sharelatex_texlive:/usr/local/texlive
        environment:

            SHARELATEX_APP_NAME: Overleaf Community Edition

            SHARELATEX_MONGO_URL: mongodb://mongo/sharelatex

            SHARELATEX_REDIS_HOST: redis
            REDIS_HOST: redis

            ENABLED_LINKED_FILE_TYPES: 'url,project_file'


            TEXMFVAR: /var/lib/sharelatex/tmp/texmf-var

            SHARELATEX_SECURE_COOKIE: 'true'
            SHARELATEX_BEHIND_PROXY: 'true'


    mongo:
        restart: always
        image: mongo:4.0
        container_name: mongo
        expose:
            - 27017
        volumes:
            - /data//overleaf/mongo_data:/data/db
        healthcheck:
            test: echo 'db.stats().ok' | mongo localhost:27017/test --quiet
            interval: 10s
            timeout: 10s
            retries: 5

    redis:
        restart: always
        image: redis:5
        container_name: redis
        expose:
            - 6379
        volumes:
            - /data/overleaf/redis_data:/data

Thank you!

HuengchI avatar Apr 09 '23 05:04 HuengchI

Hi! I'd suggest the following:

  • In config/overleaf.rc set the following environment variables:
    • MONGO_IMAGE=mongo:4.0. This should address the version incompatibility.
    • REDIS_IMAGE=redis:5
  • Copy your data into data folder:
    • /data/overleaf/sharelatex_data into data/sharelatex
    • /data//overleaf/mongo_data into data/mongo
    • /data/overleaf/redis_data into data/redis
  • Move the environment variables under environment: section into config/variables.env.

Once you're settled, I'd recommend ugrading your instance to the latest version. Check the release notes for instructions to migrate to the latest version of Mongo.

https://github.com/overleaf/overleaf/wiki/Release-Notes-3.x.x

Once that's done I'd also recommend upgrading existing history to the new Full Project History system:

https://github.com/overleaf/overleaf/wiki/Full-Project-History-Migration

mserranom avatar Apr 11 '23 08:04 mserranom