UCS 4.2-3 OwnCloud 10.0.3.3 move data folder problem

Hello,
I have recently installed Univention to my Virtual Box through Appliance installation from OwnCloud website.
Everything worked fine after installation so I decided to move the data folder.
I want to have my data physically on another drive which is shared on Windows server used as hypervisor of Virtual Box.
So I updated fstabs to mount the share to “/mnt/OCData” then I moved “files” folder from its default location (according to config.php) “/var/lib/univention-appcenter/apps/owncloud/data/” to the “/mnt/OCData” location.
Then I wanted to change owncloud data folder. So I opened Univention Configuration Registry and realized UCR var name “owncloud/directory/data” is missing. So I have created it with correct path to mounted filesystem.

Problem is that OwnCloud still presumes data folder location on the original path (/var/lib/univention-appcenter/apps/owncloud/data/). I tried to change it manually in config.php, but with no success. It seems any change UCR variable or config.php has no effect to the server.
Then I tried to move the folder and create a symlink to the mnt location which doesn’t work either.
I tried to change rights and owner of the folder and symlink to www-data already with no luck at all.

Don’t someone from you experts have any expert advice, where can I change the location correctly or what am I doing wrong with it please?

Thank you very much!

System:
Univention DC Master 4.2-3
OwnCloud 10.0.3.3
VirtualBox 5.0.20 r106931 on Windows Server 2012 R2
Debian 64-bit with 2048 MB RAM assigned

Hi,

I would suggest you install ownCloud in a Linux VM since you already have a windows server, a visualizer and know how to mount shares. That was it is much easier to manage, if you are only interested in ownCloud.

The problem with the appliance is that it’s a fixed system, and everything is configured to work out of the box. That’s why, if you want to change one thing, you have to adjust many settings, and this could be a source of errors.

If you still want to change the data directory, here is our documentation on that topic:

https://doc.owncloud.com/server/10.0/admin_manual/maintenance/manually-moving-data-folders.html?highlight=data

Hi,
im currently facing the same issue that i want to change my ownCloud data directory but without any success so far,

dmitry, thx for your support but your proposed solutions to install owncloud in a dedicated VM or the instructions in the provided link are not working for me.

Im on UCS 4.3 with onwCloud 10 and what i’d like to achive is that ownCloud is using an allready exisiting cifs-mount (/mnt/owncloud) as the data directory. All of my approaches to realize that were not successful so far (e.g. set UCR variable for the data directory, edit config,php, copy data to target mount and set softlink). My feeling is that changing the OC data directory became a bit more tricky as it is running in a docker container now.

Any support/instructions on this topic would be much appreciated!

The change of the data dir in ownCloud is not supported. If a user would change the settings, we can not guarantee that ownCloud will work if the user would update it.

You could however configure your cif mount as an external storage in ownCloud and save your data there.

here is a similar post where I explained how it works. Hope it helps.

thx again dmitry for your support!
Allow users to mount “external cifs storage” is what i’ve allready configured (as a temporary solution?).
Anyway, i’m a bit astonished that the main OC data directory must be local and cannot be changed to a storage outside of the VM - at least it seems there is no supported way to do this.

In the appliance - Yes.
On a Server - It is supported.

You consider UCS 4.3 running in a Hyper-V virtual machine as an appliance?

Sorry, can you specify your question?

What do you mean “you consider”?

My original suggestion was:

If you downloaded the appliance only for ownCloud, and want to adjust stuff - with a stand alone server it’s much easier.

sorry for confusion dmitry …
I haven’t setup a dedicated appliance for ownCloud - like it was described by crewer in the first post.

My primary (and only) instance runnining in a Hyper-V machine is UCS 4.3.
ownCloud 10.0.0.4 was deployed from the UCS appcenter. I don’t want to setup a second VM instance dedicated to onwCloud.

What i am looking for, is a way (howto/instructions) to adapt the onwCloud config in order to use external storage for the data directory. All my approches so far were not successful. My feeling is that this is somwhow releated to the docker environment that is used by UCS 4.3.

I will test mounting external storage on the host, and get back to you on this issue

1 Like

Hey,

has anyone been successfull at this topic?
Im am in the exact same situation as tpfann. The admin manual is not giving a hint besides telling the preconfigured data directory.

Best regards.

+1

Im also still looking for a working solution :slight_smile:

The advise given to solve it by setting a softlink wasnt working for me.
The ownCloud official guide for how to move the data directory isnt helpful at all because of the “dockerized” environment (https://doc.owncloud.com/server/admin_manual/maintenance/manually-moving-data-folders.html).

You could do a (bind) mount to /var/lib/univention-appcenter/apps/owncloud/data/

Hi SirTux, thank you for having a look and your reply!

As advised, I just tried to directly mount the data directory but it is still not working (this is what I get in my Browser-Window now):
"App directory "/var/www/owncloud/custom" not found! Please put the ownCloud apps folder in the ownCloud folder or the folder above. You can also configure the location in the config.php file."

Here is what I did:
service apache2 stop
cd /var/lib/univention-appcenter/apps/owncloud/data
rsync -avz /var/lib/univention-appcenter/apps/owncloud/data /mnt/owncloud
rm -r *
umount -a
vi /etc/fstab (as follows:)
//windows-server/owncloud/data /var/lib/univention-appcenter/apps/owncloud/data cifs username=USER,password=PASSWORD,domain=MYDOMAIN,uid=www-data 0 0service
mount -a
service apache2 start

There is still something wrong or missing …

When I restart ownCloud (univention-app restart owncloud), I get this now:
ERROR: for owncloud_redis_1 b'Cannot restart container da5c740e9fe346fd4fd559cb5ae4498c4bc362a737cd7344555be07095fdea6d: OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:281: applying cgroup configuration for process caused \\"mountpoint for devices not found\\"": unknown'

You may try a bind mount. So mount the SMB share to some path $my-path and do a bind mount of $my-path to /var/lib/univention-appcenter/apps/owncloud/data.

https://utcc.utoronto.ca/~cks/space/blog/linux/BindMounts

thx for the link and your reply!

But it is still now working for me … after I have added the “bind mount”, the Docker container is in a restart-loop now (redis container started fine).

Here is what I did:
univention-app stop owncloud
cd /var/lib/univention-appcenter/apps/owncloud/data
vi /etc/fstab (as follows:)
//windows-server/owncloud/data /mnt/owncloud cifs username=USER, password=PASSWORD, domain=MYDOMAIN, uid=www-data 0 0service
mount -a
rsync -avz /var/lib/univention-appcenter/apps/owncloud/data /mnt/owncloud
mount --bind /mnt/owncloud/data/ /var/lib/univention-appcenter/apps/owncloud/data
univention-app start owncloud

Just curious … have you been successful yourself with this approach?

This worked for me:

/dev/vg_ucs/owncloud    /var/lib/univention-appcenter/apps/owncloud/data        ext4    defaults,acl,user_xattr 0       0

But I’m not using Owncloud anymore. But I’m using this approach with Nextcloud now.

EDIT: But it may not be working with SMB.

Cant get it working … Everthing looks okay on the host side (after the bind mount), but from inside the container I still see the former directory struture and content.

Anyway, thanks for your efforts SirTux!

Hey @tpfann
I don’t want to claim too much, because I am quite new to the whole topic of a linux server and my knowledge is limited … But I think I got it working as desired:

-> Imagine a fresh Owncloud installation (I reinstalled it a couple of times in the last days…)
-> I have mounted a Logical Volume, based on a RAID1 array, consisting of the disks i want to save the owncloud data on, to /var/fileserver
-> I added a directory: /var/fileserver/owncloud
-> I deinstalled owncloud in ucs
-> Many of the files from owncloud inside the data folder are still existing, like the backup dir .So i moved all the remaining data to /var/fileserver/owncloud

mv /var/lib/univention-appcenter/apps/nextcloud/data* /var/fileserver/owncloud/

-> I deleted the owncloud data directory

rm -rf /var/lib/univention-appcenter/apps/owncloud/data

-> I created a softlink from the owncloud data dir to /var/fileserver/owncloud

ln -s /var/fileserver/owncloud /var/lib/univention-appcenter/apps/owncloud/data

-> I reinstalled owncloud in ucs

-> Last step: party, because it finally worked after so many read posts and tutorials :smiley:

Hi Heisenberg,

thank you for your feedback and sharing your experiance with me.

There is one difference in our setups, I have to deal with a “remote” file-system (SMB share on a Win2k16 server) whitch adds a bit more complexity (e.g. permissionings).

Nevertheless, your approach sounds very interessting and I will give it a try in my test environment.

Mastodon