Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command to change the data directory doesn't work #674

Closed
Alexis-IMBERT opened this issue Mar 2, 2024 · 11 comments
Closed

Command to change the data directory doesn't work #674

Alexis-IMBERT opened this issue Mar 2, 2024 · 11 comments

Comments

@Alexis-IMBERT
Copy link

Alexis-IMBERT commented Mar 2, 2024

Describe the bug

The following command to change the data directory of an app doesn't work properly :

yunohost app setting nextcloud data_dir -v /new/data/path

The command was suggested in this thread to change properly the data directory of Nextcloud and not break fail2ban.

In the documentation here, it say that if the directory exist, the data are moved and if it doesn't, it will the directory is created.

But I try it on my server (new clean install) and it doesn't moved the data, the new directory still doesn't exist...
However, the result of the following command change from the default path to the new one :

yunohost app setting nextcloud data_dir

Context

  • Hardware: Old laptop or computer
  • YunoHost version: 11.2.10.3 (stable).
  • I have access to my server: Through SSH | through the webadmin | direct access via keyboard / screen
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no
  • Using, or trying to install package version/branch: master I supposed (the one installed from the catalog)
  • If upgrading, current package version: can be found in the admin, or with yunohost app info $app_id

Steps to reproduce

  • Install Nextcloud
  • execute this command :
yunohost app setting nextcloud data_dir -v /new/data/path
  • Try to see the content of the new directory :
ls /new/data/path

Expected behavior

The solution could simply be an explanation of how to change the data directory properly (it's really relevant for using get Nextcloud on an bigger drive space than the one of Yunohost is running)

The best option will be a new configuration option on the web administration

PS : With explanation on what to do, I will be pleased to help on the development of this feature

Thank you of your help and investment

@OniriCorpe
Copy link
Member

OniriCorpe commented Mar 2, 2024

hi!

if the dir path changed and a folder exists at the old location, the folder will be mv'ed to the new location

it's because the docs explain the app provisionning, which occurs before the install/upgrade/restore scripts

there is no data moving where you're changing it's path using the yunohost app setting nextcloud datadir -v /new/data/path command, because it's not designed to

@Alexis-IMBERT
Copy link
Author

Alexis-IMBERT commented Mar 2, 2024

@OniriCorpe Thank you for youre answer,
So this way to change the data directory is still accurate ? (even if the doc is deprecated)

@niko2
Copy link

niko2 commented Mar 3, 2024

@Alexis-IMBERT there is a typo in the command: this is data_dir instead of datadir
then the command will effectively update the settings.yml

@Alexis-IMBERT
Copy link
Author

Hi @niko2 thank you for notice that,
This is indeed the command I used with data_dir. I corrected my first comment.

What could be the step to produce a generic script that change the data folder of Nextcloud

@Alexis-IMBERT
Copy link
Author

And I just notice that if we do an upgrade of the app :

sudo yunohost app setting nextcloud data_dir

The data folder come back to the default one :

sudo yunohost app setting nextcloud data_dir
/home/yunohost.app/nextcloud

@niko2
Copy link

niko2 commented Mar 3, 2024

Yes, you can refer to #675
Customizing data dir is not supported, apart from using a bind mount
I will try this way and eventually document it

@niko2
Copy link

niko2 commented Mar 3, 2024

I made a symbolic link and it seems to work (I could do the upgrade to the latest version of nextcloud)

@Alexis-IMBERT
Copy link
Author

@niko2 thank you for your test !

Did you do a symbolic link (ls -s ) or a bind mount (mount --bind) ?

@niko2
Copy link

niko2 commented Mar 3, 2024

as I said, a symbolic link (ln -s)

@Alexis-IMBERT
Copy link
Author

I tested it too on my server,
I don't get any trouble, so I push the doc (fr and en) on that MR : #670

@alexAubin
Copy link
Member

Closing because the original issue seem to be addressed and there are followup PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants