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

Allow to move the data/-directory #137

Closed
tflidd opened this issue Jun 16, 2016 · 12 comments
Closed

Allow to move the data/-directory #137

tflidd opened this issue Jun 16, 2016 · 12 comments

Comments

@tflidd
Copy link
Contributor

tflidd commented Jun 16, 2016

In the last owncloud-versions, moving the data/-directory was not supported: owncloud-archive/documentation#2303

Currently /var/www/owncloud/ is the default installation path for your personal cloud and users might want to change this to /var/www/nextcloud/. It's more a cosmetic change as you could add another alias to the apache-configuration:
Alias /nextcloud /var/www/owncloud

Users on shared hosting don't have this option.

@le-fractal
Copy link

The data directory and the installation directory are two different things, I think there is some confusion here.
The data directory is where the user files are, it never shows up in the URL and is thus invisible for the user (it's even recommended to place it outside the web root).

What (can) show up in the URL is the installation directory, and short of making an alias I don't see how a running process can rename its own parent folder. Users on a shared host can rename their folder via FTP if they need to.
What do you think?

@williambargent
Copy link
Member

If it is the data directory you want to rename/move it's location path is stored in the config/config.php file. All you would need to do is rename the directory and update the part parameter.
'datadirectory' => '/var/www/owncloud/data',

@tflidd
Copy link
Contributor Author

tflidd commented Jun 16, 2016

The data directory and the installation directory are two different things, I think there is some confusion here.
The data directory is where the user files are, it never shows up in the URL and is thus invisible for the user (it's even recommended to place it outside the web root).

True. But I wouldn't install by preference nextcloud to /var/www/nextcloud with a data-directory in /var/www/owncloud/data. The webserver DocumentRoot is often /var/www, it would be better to place it outside there. Furthermore, I can't easily duplicate setups (e.g. for testing).

@williambargent
Copy link
Member

@tflidd I don't understand what you are trying to achieve here. This may help:
https://help.nextcloud.com/t/howto-change-the-folder-owncloud-to-nextcloud-after-upgrading/695/4

@tflidd
Copy link
Contributor Author

tflidd commented Jun 17, 2016

I want to be able to move the data-directory. There a several reasons (I
know you can work around most of them):

  1. It's an option in the config/config.php, so people think they can
    change it (and actually do it). But it breaks some things (see link in
    earlier post)
  2. You have a new disk
  3. You move to a new server with different folder structure (very likely
    on shared hosting)
  4. You want to move the data-directory out of your DocumentRoot
  5. You want to test a new version with your setup, you copy everything
    in a separate location, duplicate the database, fix the data-path and
    db-credentials in your config/config.php. Whatever process uses the
    original data-path can actually mess up your real setup.

I don't think it's a proper solution that everyone starts to fiddle
around the database manually! The linked workaround in the forum is
neither tested nor is the list complete (e.g.
owncloud/core#20628).

On 2016-06-17 9:22, William Bargent wrote:

@tflidd [1] I don't understand what you are trying to achieve here.
This may help:
https://help.nextcloud.com/t/howto-change-the-folder-owncloud-to-nextcloud-after-upgrading/695/4

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub [2], or mute the
thread [3].

Links:

[1] https://github.com/tflidd
[2]
#137 (comment)
[3]
https://github.com/notifications/unsubscribe/AHvEYCxZCIqsPRdZrGI3hprXLUJkrdilks5qMkskgaJpZM4I3iWp

@williambargent
Copy link
Member

I have just tested moving my data directory from /var/www/nextcould to /var/www/data/smb-nextcloud and had no problems. 'smb-nextcloud' is a Samba share on my Windows Server 2012 R2.

@tflidd
Copy link
Contributor Author

tflidd commented Aug 29, 2016

Just one thing to add: If the data-directory is directly accessible, you get a warning that you should review your webserver settings or move the data/-directory out of the DocumentRoot (https://help.nextcloud.com/t/remove-index-php-from-the-url/2611/15?u=tflidd). But since moving is not supported there is a problem. Also posted upstream:
owncloud/core#25963

@tflidd
Copy link
Contributor Author

tflidd commented Aug 29, 2016

upstream owncloud/core#25970

@x1123
Copy link

x1123 commented Sep 8, 2016

i did move data directory from /var/www/nextcloud/data to /var/local/nextcloud/data and give ownership to user www-data:www-data .. everything running like a charm. It have been running for three days and nothing problem so far, hosted on ubuntu 14.04.5

@icewind1991
Copy link
Member

Moving the data directory should work on every new Nextcloud instance or any instance upgraded from ownCloud 5.0.12 or later. If someone runs into issues while moving the data directory in one such instance feel free to open a new issues for it

@tflidd
Copy link
Contributor Author

tflidd commented Jan 1, 2017

Owncloud added an article on this issue into their documentation: https://github.com/owncloud/documentation/pull/2781/files

In NC11 the logrotate-job still puts the full path of the logfile in oc_jobs.

@icewind1991

@icewind1991
Copy link
Member

@tflidd can you see if #2914 fixes that issue

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

6 participants