Kurznotiz: #nextcloud bei #allinkl ohne SSH – OCC für missing-indicies (NC25-27)

Eigentlich klappt beim Hoster All-Inkl Nextcloud ganz gut. Der Web-Updater will aber keine Indizies in die Datenbank schreiben und OCC-Web geht schon seit V25 nicht mehr. Dann geht doch nur noch das große Web-Paket, oder?

Nö. „occ“ lässt sich auch via Browser ausführen. Ist zwar umständlich, aber es geht. Wenn Du das so machen willst, denke bitte daran, alle Dateien, die wir in den nachfolgenden Schritten erzeugen, hinterher wieder zu löschen. Sie sollten nicht dauerhaft auf Deinem Webspace rumliegen.

Damit Du das machen kannst, musst Du erst einmal den relativen Pfad herausfinden, in jenem sich Deine Datei „occ“ befindet.

Recht simpel geht das mit phpInfo. Erstelle Dir also im gleichen Verzeichnis von OCC eine Datei mit dem Titel „info.php“ und folgendem Inhalt:

<?php
phpinfo();
?>

Unter kas.all-inkl.com gibt es einen recht angenehm zu nutzendes Web-FTP, damit kannst Du das zum Beispiel machen. Alternativ kannst Du auch FileZilla benutzen, sofern Du die Zugangsdaten zu Deinem FTP festgelegt hast.

Diese Datei rufst Du über den Browser auf und notierst die Antwort zu

$_ENV['SCRIPT_FILENAME']

Da steht der relative Verzeichnisname zur Datei info.php, also das gleiche Verzeichnis, in jenem sich auch „occ“ befindet. Das sollte „in etwa“ so aussehen:

/www/htdocs/w123e56/URL/PFAD/info.php

Notiere Dir den gesamten Pfad (ohne info.php) und lösche dann die Datei info.php. Anschließend erstellst Du Dir eine Datei im gleichen Verzeichnis von OCC mit dem Titel dbmaintenance.php und folgendem Inhalt:

<?php 
   exec("/usr/bin/php81 -d memory_limit=512M /(dein_relativer_pfad_zu)/occ db:add-missing-indices > dbmaintenance.txt 2>&1");
   exec("echo \"DB-Maintenance erfolgreich\" >> dbmaintenance.txt");
?>

Dabei tauschst Du „(dein_relativer_pfad_zu)“ aus, durch den zuvor notierten Pfad zur info.php.

Anschließend rufst Du die Datei dbmaintenance.php über Deinen Browser auf und gibst ihm etwas Zeit. Anschließend lädst Du in einem zweiten Schritt dbmaintenance.txt. In dieser letzten Datei sollten die Antworten von occ hinterlegt sein, also z.B. so etwas wie hier:

Check indices of the share table.
Check indices of the filecache table.
Adding additional parent index to the filecache table, this can take some time...
Filecache table updated successfully.
Check indices of the twofactor_providers table.
Check indices of the login_flow_v2 table.
Check indices of the whats_new table.
Check indices of the cards table.
Check indices of the cards_properties table.
Check indices of the calendarobjects_props table.
Check indices of the schedulingobjects table.
Check indices of the oc_properties table.
Check indices of the oc_jobs table.
Check indices of the oc_direct_edit table.
Check indices of the oc_preferences table.
Check indices of the oc_mounts table.
Adding mounts_user_root_path_index index to the oc_mounts table, this can take some time...
oc_mounts table updated successfully.
Check indices of the oc_systemtag_object_mapping table.
Adding systag_by_tagid index to the oc_systemtag_object_mapping table, this can take some time...
oc_systemtag_object_mapping table updated successfully.
Adding additional textstep_session index to the oc_text_steps table, this can take some time...
oc_text_steps table updated successfully.
DB-Maintenance erfolgreich

Sollte in der Datei nicht „DB-Maintenance erfolgreich“ stehen, ist etwas schiefgelaufen. Wenn alles erfolgreich gelaufen ist, lösche die beiden Dateien dbmaintenance.php und dbmaintenance.txt wieder.