How to migrate from a Docker Compose installation to a new Overleaf Toolkit instance?
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!
Hi! I'd suggest the following:
- In
config/overleaf.rcset the following environment variables:MONGO_IMAGE=mongo:4.0. This should address the version incompatibility.REDIS_IMAGE=redis:5
- Copy your data into
datafolder:/data/overleaf/sharelatex_dataintodata/sharelatex/data//overleaf/mongo_dataintodata/mongo/data/overleaf/redis_dataintodata/redis
- Move the environment variables under
environment:section intoconfig/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