Upgrading from version 8.1 to 8.5
Now you can remove ONLYOFFICE Community Server 8.1 from your computer. To do that run the following command from inside the Docker container:
sudo apt-get remove onlyoffice
Please do not additionally remove any files manually, just run the above command to remove ONLYOFFICE Community Server from your computer.
After that run the following command to update your ONLYOFFICE Community Server to version 8.5
sudo apt-get install onlyoffice-communityserver
The database and all necessary files should be picked up automatically from the previous version. Please run the portal and check the data for consistency and correct work.
After updating the package from version 8.1 to 8.5, the database will be upgraded, so you will need to perform the backup once again.
Upgrading from version 8.5 to versions lower than 9.1
To upgrade to versions lower than 9.1 the following must be done:
Step 1: Move data to storage outside the Docker containers
If you already installed ONLYOFFICE Community Server with the option to store the data in the folders outside the Docker containers, you can skip this step. Otherwise, you will need to backup your portal data manually as it is described in the Creating database backup section.
Step 2: Check if all the external data storage folders are mounted
Make sure that all the container volumes used to store ONLYOFFICE Community Server data are mounted using the following command:
sudo docker inspect --format='{{range $p,$conf:=.HostConfig.Binds}}{{$conf}};{{end}}' {{COMMUNITY_SERVER_ID}}
where {{COMMUNITY_SERVER_ID}} stands for the ONLYOFFICE Community Server container name or ID.
You can easily find out the current
ONLYOFFICE Community Server container name or ID using the Docker command which will list all the existing containers:
docker ps -a
Step 3: Remove the current container
sudo docker rm -f {{COMMUNITY_SERVER_ID}}
where {{COMMUNITY_SERVER_ID}} stands for the ONLYOFFICE Community Server container name or ID.
Step 4: Remove the current image
The image used to install ONLYOFFICE Community Server also needs to be removed, otherwise it will be used to install it anew and no upgrade will happen:
sudo docker rmi -f $(sudo docker images | grep onlyoffice/communityserver | awk '{ print $3 }')
Step 5: Run the new image with the same map paths
sudo docker run -i -t -d -p 80:80 \
-v /app/onlyoffice/CommunityServer/logs:/var/log/onlyoffice \
-v /app/onlyoffice/CommunityServer/data:/var/www/onlyoffice/Data \
-v /app/onlyoffice/CommunityServer/mysql:/var/lib/mysql onlyoffice/communityserver
Make sure that you run the new image with the folder paths mapped exactly as they had been mounted before you deleted ONLYOFFICE Community Server image, otherwise the data stored in these folders will not be picked up automatically.
Step 6: Restore the backup data, if necessary
If you have not mounted the folders during the previous version installation, you will need to restore data manually. To do that copy the backup data from the folders on your host machine to the new container:
sudo docker cp /home/user/Backup/Data/. {{COMMUNITY_SERVER_ID}}:var/www/onlyoffice/Data
sudo docker cp /home/user/Backup/onlyoffice/. {{COMMUNITY_SERVER_ID}}:var/log/onlyoffice
sudo docker cp /home/user/Backup/mysql/. {{COMMUNITY_SERVER_ID}}:var/lib/mysql
Where {{COMMUNITY_SERVER_ID}} stands for the ONLYOFFICE Community Server container name or ID and /home/user/Backup stands for a path to any folder on your host machine.
Alternatively, you can copy the backup data from the folders on your host machine to the new mounted folders on the host that you have specified during the new version installation:
sudo cp -a /home/user/Backup/Data/. /app/onlyoffice/CommunityServer/data
sudo cp -a /home/user/Backup/onlyoffice/. /app/onlyoffice/CommunityServer/logs
sudo cp -a /home/user/Backup/mysql/. /app/onlyoffice/CommunityServer/mysql
Where /home/user/Backup stands for a path to any folder on your host machine.
If you have created the MySQL database dump, you can restore it in the following way:
- Copy the MySQL dump file from the host machine into the new container:
sudo docker cp /home/user/dumpfile.sql {{COMMUNITY_SERVER_ID}}:/dumpfile.sql
- Enter the container:
sudo docker exec -it {{COMMUNITY_SERVER_ID}} bash
- Restore the database dump:
mysql -u root onlyoffice < dumpfile.sql
Restart Docker container:
sudo docker restart {{COMMUNITY_SERVER_ID}}
Now you can run the portal and check the data for consistency and correct work.