How can I run run occ db:add-missing-indices on shared hosting

Falls ich nicht irgend etwas anderes falsch gemacht habe, ist vielleicht der Hinweis wichtig, dass der absolute Pfad angegeben werden muss. Mit dem Symlink funktioniert der Cronjob möglicherweise nicht.

if you’ve got a Gandi hosting,
if you can’t acces to the online C-panel of your nextcloud admin account

1- activate the secureshell for your Gandi hosting :
go to Gandi.net,
in your account go to SIMPLE HOSTING,
on the panel click on Emergency shell (it will be activate for 1 hour)
copy the ssh link, something like this:
ssh YOURADMINNUMBER@console.sdXXX.gpaas.net
XXX as the Gandi server
YOURADMINNUMBER as number given on the activation domain or hosting (same as ftp user)

2-open a shell command on linux,
on windows (you have to install Putty first) and run cmd
and type or paste the link copied

Then type your password of Gandi instance (same as ftp)
we go in the nextcloud folder :
type :
cd/srv/data/web/vhosts/XXX.XXX.com/htdocs
XXX is your site
and run
php occ db:add-missing-indices

In case you do not have shell access, and also no cron-job available (for example: Hetzner’s WebHosting Level 1 - https://www.hetzner.com/webhosting), you can still run the occ db:add-missing-indices using PHP’s system() function:

  1. Create a (temporary) file named “add-db-indices.php” in your root directory (next to where occ script is located

  2. Copy & paste the following content:

<pre>
<?
system('/usr/bin/php /usr/www/users/<YOUR-USERNAME>/<PATH-TO-OCC>/occ db:add-missing-indices 2>&1');
?>
</pre>
  1. Run the file by opening in your browser https://www.your-domain.de/add-missing-indices.php

  2. Delete the add-missing-indices.php file.

  3. Done

2 Likes

I thank you very much! - It took me a while that , of course, refers to the FTP user. It works “like a charme”, also for the “occ db:convert-filecache-bigint” issue (that needs a lot more time, though). Thanks, again. - Question: Is there anybody out using a very small + simple nextcloud on Hetzner Level1? I guess there might be some issues with the 25.02 version.

Theres an app in the appstore occweb its an occ interactive console Nextcloud app

putty to the server with root, run this:
docker exec --user www-data nextcloud php occ db:add-missing-indices