@scooter
Okay I see now the issue with where id rlike 'local::'
. In some cases somehow there is more than one entry for the local data folder location, even that of course just one can really be in use (?).
So database backup from before all of this is successfully in place, yes?
Okay then log into MySQL/MariaDB console:
mysql -uroot -p
use nextcloud_db;
select * from oc_storages;
Now you should see all rows inside the table, in my case this showed up:
+---------------------------------------------+------------+-----------+--------------+
| id | numeric_id | available | last_checked |
+---------------------------------------------+------------+-----------+--------------+
| local::/mnt/dietpi_userdata/nextcloud_data/ | 2 | 1 | NULL |
| home::Micha | 3 | 1 | NULL |
| local::/mnt/sda/ncdata/ | 4 | 1 | NULL |
| home::Marilyn | 5 | 1 | NULL |
+---------------------------------------------+------------+-----------+--------------+
The 1st row local::
contains the default location on fresh Nextcloud installations via DietPi and I remember that I needed to switch it back to my external drive (3rd row). Nowadays we added an option to DietPi to adjust the data folder in front of installation process, but whatever the reason for 2 entries, update oc_storages set id='local::/new/path/to/data/' where id rlike 'local::';
would have now adjusted both and thus produced a duplicate entry.
To remove the first wrong row, I now chose the numeric_id
as unique identifier and did the following:
delete from oc_storages where numeric_id=2 limit 1;
select * from oc_storages;
+-------------------------+------------+-----------+--------------+
| id | numeric_id | available | last_checked |
+-------------------------+------------+-----------+--------------+
| home::Micha | 3 | 1 | NULL |
| local::/mnt/sda/ncdata/ | 4 | 1 | NULL |
| home::Marilyn | 5 | 1 | NULL |
+-------------------------+------------+-----------+--------------+
Nextcloud works well as before, the entries seem to just contain the “possible” data folder locations, which can be then “selected” via config.php entry, or something like this. And sadly there seems to be no cleanup done .
So in your case there should be two identical rows, just with numeric_id
different. Just use the above delete command and replace the 2
from numeric_id=2
with e.g. the higher number of the two duplicate entries.