Moving Owncloud Data Directory


#1

Hi,

I’m using owncloud 10, currently the files for the data directory is in /home/owncloud/data,

we have attached a new disk which is bigger in size, what is the best practice in moving the default data directory? example : can I just move it in /dev/sdb/owncloud/data ? and edit the config.php file?

Thank you for the assistance.


#2

Hopefully the link below will answer your question:

https://forum.owncloud.org/viewtopic.php?t=7118


#3

HI @Tombofix,

After following the instructions, I get this error

Your Data directory is invalid

Please check that the data directory contains a file ".ocdata" in its root.
Cannot create "data" directory

This can usually be fixed by <a href="https://doc.owncloud.org/server/10.0/go.php?to=admin-dir_permissions" target="_blank" rel="noreferrer">giving the webserver write access to the root directory</a>.

Thanks!


#4

When i’m clicking on the forums link i can see a red warning that the provided steps there are not supported. I think there is a reason for this and i wouldn’t follow those instructions.

Addition

I did the following search:

https://doc.owncloud.org/server/latest/admin_manual/search.html?q=move+data

and found another set of instructions which seems to me more “official”:

https://doc.owncloud.org/server/latest/admin_manual/maintenance/manually-moving-data-folders.html?highlight=move%20data


#5

Thanks Tom,

but I already did those and got the same results.

cheers!


#6

Your Data directory is invalid
Please check that the data directory contains a file “.ocdata” in its root.


#7

I would have suggested to not move the directory, but copying it to the new path. That way ypu’d have a backup so you can do some testing on the new path.


#8

so i found this a little late as i did as above as well. i restored everything back and still get ocdata invalid

our Data directory is invalid
Please check that the data directory contains a file “.ocdata” in its root.

what the fix now-----

fixed by creation .ocdata phew


#9

Wrong. You didn’t restore everything, you missed the required .ocdata file!
SCNR :wink:


#10

Best suggestion: symlink your data directory at somewhere like /mnt/data when you install, then you can move the link to point to a new mount whenever you need, and dont need to update the mappings in the database.

If you do need to update the database, follow this: https://doc.owncloud.org/server/10.0/admin_manual/maintenance/manually-moving-data-folders.html#fix-hardcoded-database-path-variables