This article will show how to upgrade/update Dolibarr on Ubuntu 20.04 or 18.04 server. The article assumes you have a fully functional, pre-installed Dolibarr server and access to the server via shell and are able to download software. If your Dolibarr software instance is hosted on a third party server, please contact the hosting provider for upgrade assistance.
To begin, make a backup of your server, then log in via SSH or a desktop session so that you can execute shell commands.
Run the command sudo –i so that you can run in root mode.
Navigate to the srv/dolibarr/documents folder and if there is a file named install.lock, delete it using the rm command.
Navigate to /srv and use the mkdir to make a directory for the new version you are downloading.
Visit the Dolibarr Github repository and identify the latest version that you wish to install. Right click on the tar.gz source code link as shown below and open it in a new tab so that you can copy and paste the URL.
From inside the newly created directory within the /srv folder, run the WGET command followed by the URL of the desired version.
Display the contents and make sure that the desired version has been downloaded as a tar.gz as shown below.
Next, extract the compressed file contents using the tar command.
tar xvf filename.tar.gz
Use the ls command to display the folder contents. You will notice that a new folder has appeared for the newly extracted version files.
Access the folder and you will notice that inside, the contents are exactly the same as in the /srv/dolibar directory.
Now we just have to replace the files in /srv/dolibarr with the newer files you just extracted.
Use the rsync command to copy and overwrite the files as follows:
rsync –a /srv/folder/newfiles/* /srv/dolibarr
Open a browser and type in the FQDN or IP you use to access Dolibarr. Append /install to your Dolibarr’s FQDN to access the upgrade page.
You will see the new version displayed.
Click on the start upgrade button to complete the upgrade.
Click next until the update has completed.
When finished, create a blank file named install.lock in the documents folder to lock the update process and secure Dolibarr.