Occ db:add-missing-columns - Security and Speed Optimize at NextcloudPi Docker

Hello I have a NextcloudPi Setup in Docker.
The Cloud is working fine, but at the security Scan, I get Several Problems.

“There are some warnings regarding your setup.
The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running “occ db:add-missing-indices” those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.
Missing index “properties_path_index” in table “oc_properties”.
The database is missing some optional columns. Due to the fact that adding columns on big tables could take some time they were not added automatically when they can be optional. By running “occ db:add-missing-columns” those missing columns could be added manually while the instance keeps running. Once the columns are added some features might improve responsiveness or usability.
Missing optional column “reference_id” in table “oc_comments”.
This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them.
bcmath
imagick”

That are my security Issues. I tried a lot of Commands to optimize the table, but it won’t work.

My Docker Setup:
Client:
Version: 19.03.11
API version: 1.40
Go version: go1.13.12
Git commit: dd360c7
Built: Mon Jun 8 20:23:26 2020
OS/Arch: linux/amd64
Experimental: false

Server:
Engine:
Version: 19.03.11
API version: 1.40 (minimum version 1.12)
Go version: go1.13.12
Git commit: 77e06fd
Built: Mon Jun 8 20:24:59 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit:
docker-init:
Version: 0.18.0
GitCommit: fec3683

I hope there are some people who have the same problems :slight_smile:
Thanks for your help!

Did you try to run the actual occ commands that are suggested in the error message?

Hi, that is my error code:

` /media/Speicher/ncdata/_data/nextcloud# occ db:add-missing-columns

Command ‘occ’ not found, but there are 21 similar ones. `

or is the occ data in another folder ?

occ is a php script that is inside the main Nextlcoud folder. You might have to add ./ to run it when you are in the main folder, so ./occ db:add-missing-columns.