Server: Add option to config/config.php for 'datadirectory.cli'

Created on 28 Jan 2020  路  4Comments  路  Source: nextcloud/server

On my shared host I do not have the same access as PHP has so the directory structure is a bit different.

Please add the option 'datadirectory.cli' to set up an alternate data directory If I run a command with occ

0. Needs triage enhancement needs info stale

Most helpful comment

You can do this already.

1) Create a new file in config/ folder: datadirectory.config.php
2) Use something like below

<?php

if (\OC::$CLI) {
    $CONFIG['datadirectory'] = '/path/cli';
} else {
    $CONFIG['datadirectory'] = '/path/web';
}

3) Be careful: Such a setup is probably unsupported hence not tested. Nextcloud should save path information relatively to datadirectory.

On my shared host I do not have the same access as PHP has so the directory structure is a bit different.

Is that a common setup? I can't see the point of it.

All 4 comments

You can do this already.

1) Create a new file in config/ folder: datadirectory.config.php
2) Use something like below

<?php

if (\OC::$CLI) {
    $CONFIG['datadirectory'] = '/path/cli';
} else {
    $CONFIG['datadirectory'] = '/path/web';
}

3) Be careful: Such a setup is probably unsupported hence not tested. Nextcloud should save path information relatively to datadirectory.

On my shared host I do not have the same access as PHP has so the directory structure is a bit different.

Is that a common setup? I can't see the point of it.

That is working very well. Thanks.
I'don't know if that is a common setup, but It's the second hoster with such a setup I have.
I'm not sure If I force creating this problem because I changed the datadirectory outside the nextcloud directory.

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

@kesselb Thanks so much, this solved the problem!!! (also after app updates or in my case inserting a backup for passwords)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rullzer picture rullzer  路  3Comments

mfechner picture mfechner  路  3Comments

juliushaertl picture juliushaertl  路  3Comments

williambargent picture williambargent  路  3Comments

Django-BOfH picture Django-BOfH  路  3Comments