Changing the DATA folder / Смена папки DATA

Всем привет, помогите пожалуйста разобраться с переносом папки data
Есть система ssd - установлена ubuntu server 20.04 и nextcloud snap 19.0.3.1 = sdb1
Стоит Raid массив из двух 500 гиговый дисков = sda1
После инсталляции nextcloud snap, я пытаюсь сменить хранилище на рейд массив путем изменения следующих параметров
*Рейд массив подключен с автомонированием и в него успешно копируются файлы *

  1. В файле /var/snap/nextcloud/current/nextcloud/config/config.php изменяю параметр ‘datadirectory’ => ‘/media/raid-hdd/nextcloud/data’,
  2. sudo snap disable nextcloud (останавливаю систему nextcloud )
  3. cp -rp /var/snap/nextcloud/common/nextcloud/ /media/raid-hdd/ (рекурсивно копирую содержимое директории data с сохранением владельца)
  4. sudo snap enable nextcloud (запускаю систему nextcloud)

при заходе на страницу получаю

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the >technical details below in your report.
More details can be found in the server log.

В чем я ошибся ? Почему сайт не запускается хотя параметры все указаны, если вернуть все обратно то будет работать все как и прежде.

Hello everyone, please help me figure out the transfer of folder data
Have ssd system - installed ubuntu server 20.04 and nextcloud snap 19.0.3.1 = sdb1
There is a Raid array of two 500 gig disks = sda1
After installing nextcloud snap, I try to change storage to raid array with the following changes

  • Raid array is connected with automonization and files are successfully copied to it *

In the file /var/snap/nextcloud/current/nextcloud/config/config.php I change the parameter ‘datadirectory’ => ‘/ media / raid-hdd / nextcloud / data’,
sudo snap disable nextcloud (stop nextcloud system)
cp -rp / var / snap / nextcloud / common / nextcloud / / media / raid-hdd / (recursively copy the contents of the data directory while maintaining the owner)
sudo snap enable nextcloud (start nextcloud system)
when entering the page I get

Internal Server Error

The server encountered an internal error and was unable to fulfill your request.
Contact your server administrator, if this error occurs multiple times, include the> technical details below in your report.
More details can be found in the server log.

Where did I go wrong? Why the site does not start, although the parameters are all specified, if you return everything back, everything will work as before.

you copied the wrong contents with

cp -rp / var / snap / nextcloud / common / nextcloud / / media / raid-hdd / (recursively copy the contents of the data directory while maintaining the owner)

I am not sure where snap stores its default data.
You could find it where the old ‘datadirectory’ => pointed to.
These are the contents to be copied to your new location you said.

cp -rp /var/snap/nextcloud/common/nextcloud/ /media/raid-hdd/nextcloud/data/

in here ‘/media/raid-hdd/nextcloud/data/’ should be folders of usernames and nextcloud.log and a folder appdata_nnnnnnn where nnnn is the ‘instanceid’

you can change the config.php ‘datadirecory’ => /media/raid-hdd/nextcloud/data/
to point to the right location.

what is the output of

ls -la /media/raid-hdd/nextcloud/

ps.

you should have done

cp -rp /var/snap/nextcloud/common/nextcloud/data/ /media/raid-hdd/nextcloud/data/

reference:

Thanks for the answer, but the method of replacing the data folder still does not work for me

what is the result

ls -la /media/raid-hdd/nextcloud/

the result is

smart@krasnodar9:~$ ls -la /media/raid-hdd/nextcloud/
total 12
drwxr-xr-x 3 root root 4096 Sep 16 16:59 .
drwxr-xr-x 3 root root 4096 Sep 16 16:56 ..
drwxrwx--- 5 root root 4096 Sep 16 13:27 data
smart@krasnodar9:~$

I tried to delete everything from the directory /media/raid-hdd/ and copy it as you wrote like cp -rp /var/snap/nextcloud/common/nextcloud/data/ /media/raid-hdd/nextcloud/data/

but no result

my data
direc

have you followed this ?

especially did you run

sudo snap connect nextcloud:removable-media

it all worked !!! excellent thank you! what exactly did this team do?