ounCloud refresh file system with DB once files restored

I have been restoring several files under specific user into ownCloud solution; I have found in some forum that we could refresh the files records upon the filesystem.

 

The table name is : oc_filecache

If you delete manually all the content of this table (something like : Delete * from oc_filecache); Logout and login back; All the content would be refreshed.

Here is the php that I wrote to make it:

<?php
$mysql_hostname = "localhost";
$mysql_database = "owncloud";
$mysql_password = "password";
$mysql_user = "db_user";

$bd = mysqli_connect($mysql_hostname, $mysql_user, $mysql_password, $mysql_database);

// Check connection

if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

// removing db records also

        $sql = "DELETE FROM `owncloud`.`oc_filecache`";
        $result=mysqli_query($bd, $sql);

// IF DELETE SUCCESSFUL

        if($result){
        echo "Success. DB has been purged.";
        } else {
        echo "Something went wrong with the DB.";
        }

Leave a Reply

Your email address will not be published. Required fields are marked *