Skip to content

Storage IDs

Matthew Setter edited this page Jul 9, 2018 · 7 revisions

Storages

The current database can hold different types of storages this text should explain what storage types are created in which cases, how they are used by our file system handler and how they are linked to a specific user.

Types

local::

Storage IDs that start with local:: describe paths on the local filesystem. They contain an absolute path to the folder they describe. There is one special storage here, it is a storage with the path of the data directory. If the data directory is set as /path/to/data/dir, the following storage will be present: local::/path/to/data/dir. If you use the files_external app, you could also mount local folder into your ownCloud. In this case also a local:: storage is created.

home::

The home:: storages are the prefered way to reference a users home folder inside the datadir. The storage ID is in the formathome::USERNAME where USERNAME is the internal ownCloud name. It is also essential, that this could be different from the actual folder. If the user backend returns a different folder name via getHome(). Existing user folder in the local:: storage format are migrated automatically to the home:: storage in ownCloud 8.0.

Two storages for one user

There was a bug in previous version of ownCloud 6 and 7 that lead to a local:: and a home:: storage for a users home directory. In this case the local:: one takes precedence. With a manual database investigation it may be possible to analyze which storage is more up to date and get rid of the duplicate storage situation. Only the home:: storage should be left.

shared::

Remote shared folders are represented as a shared:: storage since ownCloud 7. Theses are named like this: shared::md5(TOKEN@REMOTE) from the table oc_share_external.

Random number/string

If one of the above storages would result in an ID that is longer than 64 characters the MD5 sum is computed and stored instead. The storage ID local::/a/very/long/path/to/the/ownclouds/data/directory/to/show/md5/sum/creation/someRandomUserName/ would result in the MD5 sum d12cbffed869a22c311cb51317ee8a60 which is then stored instead in the database.