I’ve seen that in MongoDB the CMS stores not only the current version of the courses but all the history, since the course creation. This causes the Mongo DB to grow continuously, raising up to hundreds of gigas and more for long lasting instances.
Is there any safe method to reduce the size of the Mongo DB, without losing current course structures and not breaking the installation?
There is a python script called structures.py that I have used to shrink the mongo db.
Since this is something that I intend to run frequently, I built a docker image for this project:
FROM python:3.8-buster
RUN git clone https://github.com/openedx/tubular.git
WORKDIR /tubular
RUN pip install -e .[dev]
WORKDIR /tubular/tubular/scripts
I ran the docker container on the same host that is running our production tutor images:
docker run -it --rm --net=tutor_local_default openedx-tubular bash
@Andres.Aulasneo: You might want to hold off on this a bit if you’re running Nutmeg, as there’s a recently investigated peculiarity around the MongoDB/MySQL switchover that may make this unsafe (@braden: do you remember the status of this?)
No firm target. Definitely not something that’s going to happen in the Olive timeframe. We’re currently ramping up work on killing the Old Mongo Modulestore, which stopped being the default sometime back in 2013 or 2014, and which we had planned to kill way back in Koa.