Skip to content
This repository has been archived by the owner. It is now read-only.

how to move data directory, new page #1588

Closed
wants to merge 2 commits into from

Conversation

@carlaschroder
Copy link
Contributor

commented Aug 18, 2015

re: #1391

@PVince81

This comment has been minimized.

Copy link
Member

commented Aug 19, 2015

Thanks. Recently an additional problem has been discovered here owncloud/core#18134 (scroll down to the DB snippet).
Basically when you move the data directory, there is still a single entry in the database that points to the old folder.

The admin will need to adjust this entry manually to make sure everything works properly.
In the future, I hope we can get rid of this hard-coded path altogether.

@carlaschroder

This comment has been minimized.

Copy link
Contributor Author

commented Aug 19, 2015

@PVince81, it sounds more complicated than adjusting a DB entry. This applies only to encrypted data dirs, corect?

@carlaschroder

This comment has been minimized.

Copy link
Contributor Author

commented Aug 21, 2015

DON'T MERGE until db issue is sorted out

@carlaschroder

This comment has been minimized.

Copy link
Contributor Author

commented Nov 3, 2015

@PVince81 What is the status of this? It's not high priority, but it is kind of cool :)

@ghost ghost referenced this pull request Nov 19, 2015
@ghost

This comment has been minimized.

Copy link

commented Nov 20, 2015

Another thing what needs to be fixed before moving the datadir will be supported: owncloud/core#20628

@fulaphex

This comment has been minimized.

Copy link

commented on 5a40712 Nov 25, 2015

I guess You should also change from
"$ sudo cp -r /var/www/owncloud/data /var/storage"
to
"$ sudo -u www-data cp -r /var/www/owncloud/data /var/storage"
If You don't run this as www-data or some other user for other distros than debian, You will have file owner issues, because the owner of those new, copied files will be Your user, not www-data. That is the problem I have faced and it doesn't allow to update filepaths with maintenance:repair.

This comment has been minimized.

Copy link
Contributor

replied Nov 25, 2015

Yes, that's true @fulaphex. I'll add some examples for other distros. I'm waiting for a couple of issues in core to be resolved.

This comment has been minimized.

Copy link

replied Nov 25, 2015

Glad that I could help You

@ghost

This comment has been minimized.

Copy link

commented Feb 9, 2016

Something additional to consider:

A lot of people are struggling with permission issues after moving the datadir. Those issues are mostly caused by:

  • SELinux
  • open_basedir
  • wrong linux permissions of the new folder (and its parents folders e.g. /opt/owncloud AND /opt)
  • wrong permissions during mount time (e.g. /etc/fstab) if the datadir is placed on an external hdd
  • readonly mounted partition
@AllARTSoftworks

This comment has been minimized.

Grant www-data permissions on new location, i.e.
/var/storage

$ sudo chown -R www-data:www-data /var/storage

@carlaschroder

This comment has been minimized.

Copy link
Contributor Author

commented Mar 21, 2016

I'm closing this. There is little user demand for this, there are still unresolved issues, and the most reliable way is to make a fresh oC installation with a new data directory, and restore from backup.

@carlaschroder carlaschroder deleted the movedatadir branch Mar 21, 2016

@ghost

This comment has been minimized.

Copy link

commented Mar 21, 2016

There is little user demand for

From my experience there is a high user demand for this and the question is coming up quite often at IRC and forums. So at least this:

the most reliable way is to make a fresh oC installation with a new data directory, and restore from backup.

should be documented.

@quizilkend

This comment has been minimized.

Copy link

commented May 24, 2016

I'm not sure if this belongs here, but I think that this is a somehor reliable solution:
https://manandkeyboard.tk/2014/09/15/owncloud-and-an-external-hard-drive/

@tavinus

This comment has been minimized.

Copy link

commented Jul 9, 2016

I have just made a fresh install and will reinstall everything again to have my data folder separated. This wouldn't happen if there was ANY mention to this on the installation instructions. Any serious installation would probably have the data folder separated. So now, I will have to at least remove my owncloud database and recreate it to install again. Please document this on the installation instructions (letting us know we should decide this BEFORE installing).

@quizilkend I am not sure the solution you linked is any different from the ones before. I would guess there is still that database entry with the old folder listed. At this point I would suppose that symlinking the new folder to where the old one was is a better solution if you are not fixing the database entry.

@ghost

This comment has been minimized.

Copy link

commented Jul 9, 2016

@tavinus Contributions to the documentation are welcome. You can create a Pull Request with the suggested changes. An issue to document this is open at #2303, some one just needs to write it down. And as always this won't happen magically :-/

@MostHated

This comment has been minimized.

Copy link

commented Sep 14, 2016

@stuckj

This comment has been minimized.

Copy link

commented Aug 11, 2017

This isn't a general purpose solution, but if you install OC as a docker container you can volume mount the data directory to an external location. To OC it will still be in the same place. This won't alleviate any permissions issues of course. But, if you volume mount using an NFS driver (like rancher-nfs) then you can setup the NFS share to use your www-data user and group in a mountall option to help alleviate those problems.

@settermjd settermjd self-assigned this Aug 14, 2017

@settermjd settermjd added this to the Weekly Sprint :: Aug 7 - 11 milestone Aug 14, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
9 participants
You can’t perform that action at this time.