Hello everyone
I am not sure if this is the right topic, because my nextcloud is already set. But I do not find a topic where USB drive problems are under discussion. So this is the topic that fits best in my opinion.
I have a question that should be easy to answer, but I cannot find a solution:
How can I further use a running nextcloudpi instance but start with new empty data directory and database?
(I would like to avoid re-installing Nextcloudpi so that I donât have to configure everything anew.)
Background information:
I use ncp 1.53.1.
I want to use a new (bigger) USB-drive as datastorrage at raspi, without resetting the nextcloudpi installed on the SD-Card.
The USB-drive is formated as a BTRFS partition and listed: /media/silverStick
The problem is, that nextcloudpi wants me to move data directory and I have to chose the Data directory path. But the USB-drive is empty and so it is not possible. Prompting the ncdata-directory (and the database-directory) that do not exist as destination does not work.
â data directory /media/silverStick/ncdata/data not found
So I tried to create a new directory with the name âncdataâ but that does not help.
â>0 drwxr-xr-x 1 root root 0 Feb 16 10:58 ncdata
even when I change owner (chown) root to www-data
The Question is: How can I create the ncdata- and the ncdatabase-directory on the new formated usb-drive properly?
⌠I had to create a second subfolder âdataâ the same way.
Then the process of moving datadir using ncp tool worked fine for me.
But that was just the first part of the problem.
It seems like the second part can not be solved this wayâŚ
Because after this success I tried the same solution for the database and this does not work.
An unhandled exception has been thrown: Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:140
The database should be created here from scratch, and I do not understand, how to tell the nextcloudpi to do this?
Thank you Oliver.
This function/sript was new for me.
I tried my best, but it seems like it is not working the way it should.
After a permission problem that I was able to solve by changing the owner of the directory to mysql, the NCP is running the init-script a little further. But in the end it throws an exception:
[ERROR] Fatal error: Canât open and lock privilege tables: Table âmysql.dbâ doesnât exist
This sounds funny to me, because isnât the idea of this script to create the database with the neccessary tables?
Hm, I am a little surprised. I really thought, that this problem could be solved by some cracks out there pretty easily. But it seems to be more complicated and challenging than it initially looked.
For me it looks like a bug. All in all I it looks to me like some of nextcloudpi-scripts are still quite buggy. Could it be that the program still has some teething troubles and is simply not yet fully developed?
Is nobody out there who has already done a memory expansion and also faced the problem that the database had to be set up on the stick?
Or could it be that this bug was only integrated in one of the last updates?