Update Docker to 21.1
Docker images are mainly created for trialing/testing the product and are not optimized for production servers.
Before upgrade:
- Make a backup or take a snapshot of your server..
- Read the steps below completely. If you have a custom docker-compose file configuration, make sure that you understand the changes, and if you have any questions, please contact Filecloud support.
Mongo database upgrade
Only follow these steps if your MongoDB version is 3.6 or higher).
These steps are based on the docker-compose.yml file we provided. If you have any custom docker-compose configurations or volumes, please use any custom paths, filenames, etc. when following these steps.
Beginning with Filecloud version 21.1, MongoDB version 4.2 is being used. This requires you to:
- First, upgrade the MongoDB container from 3.6 to 4.0.
- Then, set feature compatibility to 4.0.
- Upgrade the MongoDB container from 4.0 to 4.2
- Then, set feature compatibility to 4.2
Perform the upgrade
Enter the following into the command line:
docker exec -it filecloud.mongodb bash -c 'mongo --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"3.6\" } )"' docker-compose down
Edit your docker-compose.yml file to point to the new images (or download the new docker-compose.yml file and edit it).
Enter the following:sed -i "s/20.2/21.1/g" docker-compose.yml sed -i "s/20.1/21.1/g" docker-compose.yml sed -i "s/mongo:3.6/mongo:4.0/g" docker-compose.yml
To list all the volumes, enter:
docker volume ls
The volume var_html will contain old FileCloud codes, so remove it by entering the command below. If you have any custom entries (for example, in cloudconfig.php or localstorage.php, please make sure to back up those files.docker volume rm var_html
Please note that the environment variable is now mongodb_data_container. In 3.6 it was MONGO_DATA_DIR
Make sure you set the environment variable to mongodb_data_container in 4.0 and 4.2.
The MongoDB service in the compose file should appear similar to:version: '3' services: filecloud.mongodb: container_name: 'filecloud.mongodb' image: mongo:4.0 environment: - mongodb_data_container:/data/db volumes: - mongo_database:/data/db ports: - "27017:27017" volumes: mongo_database:
. Start the containers:
docker-compose up -d docker exec -it filecloud.mongodb bash -c 'mongo --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"4.0\" } )"'
Upgrade to Mongdb to 4.2
sed -i "s/mongo:4.0/mongo:4.2/g" docker-compose-mongodb.yml docker-compose -f docker-compose-mongodb.yml up -d docker exec -it filecloud.mongodb bash -c 'mongo --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"4.2\" } )"'