Manually Moving Data Folders

I was manually moving the data folder to a new location. I followed the instructions at

I accidentally missed the step where you need to update the entry in the oc_storages table. All the other table updates where completed successfully.

My installation isn’t showing any problems so far (except for the table now having both data paths). I am wondering if there are any potential problem that could result from this. If so, how can I correct this the right way?

Steps to reproduce

  1. Follow instructions at
  2. Make an oops (forget to update oc_storages table)
  3. Run SQL query mysql owncloud -e "SELECT * FROM oc_storages;"

Expected behaviour

The old data folder (local::/usr/local/www/owncloud/data/) should have been replaced with the new one (local::/media/cloud/data/)

Actual behaviour

The old folder remains and the new folder is added as a new row.

| id                                   | numeric_id | available | last_checked |
| local::/usr/local/www/owncloud/data/ |          3 |         0 |         NULL |
| local::/media/cloud/data/            |         32 |         1 |         NULL |

Server configuration

Operating system:

Web server:
Apache 2.4

MySQL 5.7

PHP version:

ownCloud version: (see ownCloud admin page)

Updated from an older ownCloud or fresh install:
Updating to each release since maybe 6.0. FYI, This is not an update/upgrade related question.

Where did you install ownCloud from:
OS Package

Signing status (ownCloud 9.0 and above):

The content of config/config.php:

    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "\/media\/cloud\/data",
        "dbtype": "mysql",
        "version": "",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "forcessl": false,
        "theme": "",
        "maintenance": false,
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        "secret": "***REMOVED SENSITIVE VALUE***",
        "forceSSLforSubdomains": false,
        "loglevel": 0,
        "trashbin_retention_obligation": "auto",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Memcached",
        "memcached_servers": [
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "localhost",
            "port": 6379

List of activated apps:

  - encryption
  - external
  - notes
  - qownnotesapi
  - user_external

Are you using external storage, if yes which one: local/smb/sftp/…

Are you using encryption: yes/no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/…

Client configuration

Firefox 78.0.2

Operating system:
Windows 7

If there is nothing else referring to the first oc_storages entry I don’t see a problem removing it.
So go through the article again, identify tables that might reference this entry. And based on the documentation build selects with which you can identify potential problems. If all is good you can continue:

But please make sure you do this in as safe as possible way though:

  1. Turn on maintenance mode & potentially stop apache
  2. Take a DB backup
  3. Start a transaction
  4. Run the select to see the whole table
  5. Perform your deletion
  6. Confirm you only deleted what you wanted to delete, by rerunning the select from step 4.
  7. Commit transaction if good, otherwise rollback
  8. Restart ownCloud (turn off maintenance & start apache)
1 Like