Moving Owncloud Data Directory

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.

Hopefully the link below will answer your question:

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

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!

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

Thanks Tom,

but I already did those and got the same results.

cheers!

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

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.

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

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

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

1 Like

Hi. I came across this topic as I’m looking to move the file data share currently in use to another physical location.

We have a new file server so all the existing file shares are being moved to it.
The OwnCloud data location is one these shares. I can see in the config.php file the “datadirectory” field points to /mnt/itMeCloud/data however I don’t know how to find out what that actually is since the actual share is \cluster-fs\itmecloud and will be moving to \svr-file\filesharedata\system\mecloud

As you might have guessed I’m not familiar with Linux / Unix so a very basic step by step this is what you have to do guide would be most helpful.

thanks in advance.

Paul.

This is close to impossible via a forum. I recommend you create a test environment where you try your changes, document them, gauge the impact and plan your upgrade for production.

You will have to follow the instructions of the link posted in the post above.

1 Like