Accidently moved a large folder (47GB) into a subfolder - how to restore?

Hi,

I hope someone can help me.

We have a large OwnCloud running on a Debian Linux Server with latest 10.6.0 version and
around 20 users and 300 GB in a couple of main folders with many subfolders.

Now, accidently, one user with full write access moved one of these main folders in Windows Explorer using desktop client, let us call it “Support”, 47GB in size with many subfolders and thousands of files into another main folder, let us call it “Production”. Then the new path is not /Support it is then /Production/Support.

That happened yesterday and I thought the best way would be to wait until all synchronisation from between that desktop client and our server and all other clients that were active at that time and also having a share of “Support” and “Production” is finished.

I guess that was not the best idea. After many hours of synchronisation, it ended up with a message in the desktop client logs, that “Production/Support” folder has been deleted! I have no idea why, nobody touched anything.

Now I see the folder in admin panel in trashbin, but “Production/Support” is just an empty folder. I was able to restore it, but it is empty. Where are all the subfolders and files in these subfolders in trashbin? I do not see them at all in trashbin.

How to restore it?

What would have been a better reaction on such an accidential movement of a large folder? Closing desktop client to stop synchronisatzion with server and move it back locally, immediatly? Start desktop client then again and hope all will be reverted that has already been synchronised until that accident has been noted?

Any help is highly appreciated.
Thank you!
Niko

If the version restored from the trashbin is empty, you will have to restore it from backup most likely.

Do you have a quota or a trashbin retention defined?

If you are moving files that should also just trigger a move on the server side as far as I know. I probably would have instinctively stopped the ownCloud client, moved it back and restarted the ownCloud client. As all files are still in the local desktop installation, there’s no data loss as long as it is possible to re-upload them.

But not sure what the best course of action would have been from an ownCloud client perspective. Perhaps @michaelstingl or @TheOneRing know more?

Hello!
Here are the relevant errors. Running occ files:scan seems to somehow fix the situation.
[message] => unable to rename, file does not exists : files/Mindfield/Support

[message] => Exception: An exception occurred while executing ‘UPDATE oc_filecache SET mtime = GREATEST(mtime, ?), etag = ?, size = CASE WHEN size > ‘-1’ THEN size + ? ELSE size END WHERE (storage = ?) AND (path_hash IN (‘d41d8cd98f00b204e9800998ecf8427e’, ‘45b963397aa40d4a0063e0d85e4fe7a1’, ‘a93cc0c87af512473ea30be49b5e6ad5’, ‘a4afb7f6d765b67fc9ccd1ee6b9ca833’, ‘e15e32259ceff4834f427a34079abd61’, ‘a840fac3f34a9a489caa17303b720e79’, ‘52b84614e1749c01c6efc51befbbe8d2’, ‘fe5136cc62555274aceefa6f5ee7bde6’))’ with params [1580300256, “603395c305a54”, 7783327, 3]:

[message] => Caused by: {“Exception”:“Doctrine\DBAL\Driver\PDOException”,“Message”:“SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction”,“Code”:“40001”,“Trace”:"#0 /var/www/html/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1073): Doctrine\DBAL\Driver\PDOStatement->execute()\n#1 /var/www/html/lib/private/DB/Connection.php(207): Doctrine\DBAL\Connection->executeUpdate(‘UPDATE oc_file...', Array, Array)\n#2 /var/www/html/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(210): OC\\DB\\Connection->executeUpdate('UPDATE oc_file…’, Array, Array)\n#3 /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php(141): Doctrine\DBAL\Query\QueryBuilder->execute()\n#4 /var/www/html/lib/private/Files/Cache/Propagator.php(101): OC\DB\QueryBuilder\QueryBuilder->execute()\n#5 /var/www/html/lib/private/Files/Cache/HomePropagator.php(47): OC\Files\Cache\Propagator->propagateChange(‘files/Mindfield…’, 1580300256, 7783327)\n#6 /var/www/html/apps/files_sharing/lib/SharedPropagator.php(42): OC\Files\Cache\HomePropagator->propagateChange(‘files/Mindfield…’, 1580300256, 7783327)\n#7 /var/www/html/lib/private/Files/Cache/Updater.php(138): OCA\Files_Sharing\SharedPropagator->propagateChange(‘Produktion/Supp…’, 1580300256, 7783327)\n#8 /var/www/html/apps/dav/lib/Connector/Sabre/File.php(102): OC\Files\Cache\Updater->update(‘Produktion/Supp…’, 1580300256)\n#9 /var/www/html/apps/dav/lib/Connector/Sabre/File.php(279): OCA\DAV\Connector\Sabre\File->handleMetadataUpdate(Object(OCA\Files_Trashbin\Storage), ‘Produktion/Supp…’)\n#10 /var/www/html/apps/dav/lib/Connector/Sabre/Directory.php(172): OCA\DAV\Connector\Sabre\File->put(Resource id #20)\n#11 /var/www/html/lib/composer/sabre/dav/lib/DAV/Server.php(1098): OCA\DAV\Connector\Sabre\Directory->createFile(‘Tanzendes M\xC3\xA4dc…’, Resource id #20)\n#12 /var/www/html/lib/composer/sabre/dav/lib/DAV/CorePlugin.php(504): Sabre\DAV\Server->createFile(‘files/monika.be…’, Resource id #20, NULL)\n#13 /var/www/html/lib/composer/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#14 /var/www/html/lib/composer/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server->emit(‘method:PUT’, Array)\n#15 /var/www/html/lib/composer/sabre/dav/lib/DAV/Server.php(253): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#16 /var/www/html/apps/dav/lib/Server.php(330): Sabre\DAV\Server->start()\n#17 /var/www/html/apps/dav/appinfo/v2/remote.php(31): OCA\DAV\Server->exec()\n#18 /var/www/html/remote.php(165): require_once(’/var/www/html/a…’)\n#19 {main}",“File”:"/var/www/html/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php",“Line”:131}

[message] => Caused by: {“Exception”:“PDOException”,“Message”:“SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction”,“Code”:“40001”,“Trace”:"#0 /var/www/html/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(129): PDOStatement->execute(NULL)\n#1 /var/www/html/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1073): Doctrine\DBAL\Driver\PDOStatement->execute()\n#2 /var/www/html/lib/private/DB/Connection.php(207): Doctrine\DBAL\Connection->executeUpdate(‘UPDATE oc_file...', Array, Array)\n#3 /var/www/html/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(210): OC\\DB\\Connection->executeUpdate('UPDATE oc_file…’, Array, Array)\n#4 /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php(141): Doctrine\DBAL\Query\QueryBuilder->execute()\n#5 /var/www/html/lib/private/Files/Cache/Propagator.php(101): OC\DB\QueryBuilder\QueryBuilder->execute()\n#6 /var/www/html/lib/private/Files/Cache/HomePropagator.php(47): OC\Files\Cache\Propagator->propagateChange(‘files/Mindfield…’, 1580300256, 7783327)\n#7 /var/www/html/apps/files_sharing/lib/SharedPropagator.php(42): OC\Files\Cache\HomePropagator->propagateChange(‘files/Mindfield…’, 1580300256, 7783327)\n#8 /var/www/html/lib/private/Files/Cache/Updater.php(138): OCA\Files_Sharing\SharedPropagator->propagateChange(‘Produktion/Supp…’, 1580300256, 7783327)\n#9 /var/www/html/apps/dav/lib/Connector/Sabre/File.php(102): OC\Files\Cache\Updater->update(‘Produktion/Supp…’, 1580300256)\n#10 /var/www/html/apps/dav/lib/Connector/Sabre/File.php(279): OCA\DAV\Connector\Sabre\File->handleMetadataUpdate(Object(OCA\Files_Trashbin\Storage), ‘Produktion/Supp…’)\n#11 /var/www/html/apps/dav/lib/Connector/Sabre/Directory.php(172): OCA\DAV\Connector\Sabre\File->put(Resource id #20)\n#12 /var/www/html/lib/composer/sabre/dav/lib/DAV/Server.php(1098): OCA\DAV\Connector\Sabre\Directory->createFile(‘Tanzendes M\xC3\xA4dc…’, Resource id #20)\n#13 /var/www/html/lib/composer/sabre/dav/lib/DAV/CorePlugin.php(504): Sabre\DAV\Server->createFile(‘files/monika.be…’, Resource id #20, NULL)\n#14 /var/www/html/lib/composer/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#15 /var/www/html/lib/composer/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server->emit(‘method:PUT’, Array)\n#16 /var/www/html/lib/composer/sabre/dav/lib/DAV/Server.php(253): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#17 /var/www/html/apps/dav/lib/Server.php(330): Sabre\DAV\Server->start()\n#18 /var/www/html/apps/dav/appinfo/v2/remote.php(31): OCA\DAV\Server->exec()\n#19 /var/www/html/remote.php(165): require_once(’/var/www/html/a…’)\n#20 {main}",“File”:"/var/www/html/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php",“Line”:129}

[message] => Exception: {“Exception”:“Doctrine\DBAL\Exception\UniqueConstraintViolationException”,“Message”:“An exception occurred while executing ‘UPDATE oc_filecache SET storage = ?, path = ?, path_hash = ? WHERE fileid = ?’ with params [3, “files_versions/Mindfield/Produktion/Support/Gebrauchsanweisungen/eSense Skin Response & Temperature/Deutsch/eSense_Skin_Response_Handbuch_DE.pdf.v1544758761”, “ce2f1488e6f1eb94b4aeff747bc714dd”, “361795”]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘3-ce2f1488e6f1eb94b4aeff747bc714dd’ for key ‘fs_storage_path_hash’”,“Code”:0,“Trace”:"#0 /var/www/html/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(172): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException(‘An exception oc…’, Object(Doctrine\DBAL\Driver\PDOException))\n#1 /var/www/html/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(151): Doctrine\DBAL\DBALException::wrapException(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), ‘An exception oc…’)\n#2 /var/www/html/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(165): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), ‘UPDATE `oc_file…’, Array)\n#3 /var/www/html/lib/private/Files/Cache/Cache.php(591): Doctrine\DBAL\Statement->execute(Array)\n#4 /var/www/html/lib/private/Files/Cache/Cache.php(535): OC\Files\Cache\Cache->moveFromCache(Object(OC\Files\Cache\HomeCache), ‘files_versions/…’, ‘files_versions/…’)\n#5 /var/www/html/lib/private/Files/Cache/Updater.php(195): OC\Files\Cache\Cache->move(‘files_versions/…’, ‘files_versions/…’)\n#6 /var/www/html/lib/private/Files/View.php(345): OC\Files\Cache\Updater->renameFromStorage(Object(OCA\Files_Trashbin\Storage), ‘files_versions/…’, ‘files_versions/…’)\n#7 /var/www/html/lib/private/Files/View.php(886): OC\Files\View->renameUpdate(Object(OCA\Files_Trashbin\Storage), Object(OCA\Files_Trashbin\Storage), ‘files_versions/…’, ‘files_versions/…’)\n#8 /var/www/html/lib/public/Events/EventEmitterTrait.php(50): OC\Files\View->OC\Files\{closure}(*** sensitive parameters replaced )\n#9 /var/www/html/lib/private/Files/View.php(919): OC\Files\View->emittingCall(Object(Closure), Array, ‘file’, ‘rename’)\n#10 /var/www/html/apps/files_versions/lib/Storage.php(297): OC\Files\View->rename(’/nikohk83/files…’, ‘/nikohk83/files…’)\n#11 /var/www/html/apps/files_versions/lib/Hooks.php(102): OCA\Files_Versions\Storage::renameOrCopy(‘Mindfield/Suppo…’, ‘Mindfield/Produ…’, ‘rename’)\n#12 /var/www/html/lib/private/legacy/hook.php(103): OCA\Files_Versions\Hooks::rename_hook(Array)\n#13 /var/www/html/lib/private/Files/View.php(904): OC_Hook::emit(‘OC_Filesystem’, ‘post_rename’, Array)\n#14 /var/www/html/lib/public/Events/EventEmitterTrait.php(50): OC\Files\View->OC\Files\{closure}( sensitive parameters replaced ***)\n#15 /var/www/html/lib/private/Files/View.php(919): OC\Files\View->emittingCall(Object(Closure), Array, ‘file’, ‘rename’)\n#16 /var/www/html/apps/dav/lib/Connector/Sabre/Directory.php(481): OC\Files\View->rename(’/Mindfield/Supp…’, ‘/Mindfield/Prod…’)\n#17 /var/www/html/lib/composer/sabre/dav/lib/DAV/Tree.php(160): OCA\DAV\Connector\Sabre\Directory->moveInto(‘Support’, ‘files/monika.be…’, Object(OCA\DAV\Connector\Sabre\Directory))\n#18 /var/www/html/lib/composer/sabre/dav/lib/DAV/CorePlugin.php(612): Sabre\DAV\Tree->move(‘files/monika.be…’, ‘files/monika.be…’)\n#19 /var/www/html/lib/composer/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\CorePlugin->httpMove(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#20 /var/www/html/lib/composer/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server->emit(‘method:MOVE’, Array)\n#21 /var/www/html/lib/composer/sabre/dav/lib/DAV/Server.php(253): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#22 /var/www/html/apps/dav/lib/Server.php(330): Sabre\DAV\Server->start()\n#23 /var/www/html/apps/dav/appinfo/v2/remote.php(31): OCA\DAV\Server->exec()\n#24 /var/www/html/remote.php(165): require_once(’/var/www/html/a…’)\n#25 {main}",“File”:"/var/www/html/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php",“Line”:59}

[message] => Caused by: {“Exception”:“PDOException”,“Message”:“SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘3-ce2f1488e6f1eb94b4aeff747bc714dd’ for key ‘fs_storage_path_hash’”,“Code”:“23000”,“Trace”:"#0 /var/www/html/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(129): PDOStatement->execute(Array)\n#1 /var/www/html/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(155): Doctrine\DBAL\Driver\PDOStatement->execute(Array)\n#2 /var/www/html/lib/private/Files/Cache/Cache.php(591): Doctrine\DBAL\Statement->execute(Array)\n#3 /var/www/html/lib/private/Files/Cache/Cache.php(535): OC\Files\Cache\Cache->moveFromCache(Object(OC\Files\Cache\HomeCache), ‘files_versions/…’, ‘files_versions/…’)\n#4 /var/www/html/lib/private/Files/Cache/Updater.php(195): OC\Files\Cache\Cache->move(‘files_versions/…’, ‘files_versions/…’)\n#5 /var/www/html/lib/private/Files/View.php(345): OC\Files\Cache\Updater->renameFromStorage(Object(OCA\Files_Trashbin\Storage), ‘files_versions/…’, ‘files_versions/…’)\n#6 /var/www/html/lib/private/Files/View.php(886): OC\Files\View->renameUpdate(Object(OCA\Files_Trashbin\Storage), Object(OCA\Files_Trashbin\Storage), ‘files_versions/…’, ‘files_versions/…’)\n#7 /var/www/html/lib/public/Events/EventEmitterTrait.php(50): OC\Files\View->OC\Files\{closure}(*** sensitive parameters replaced )\n#8 /var/www/html/lib/private/Files/View.php(919): OC\Files\View->emittingCall(Object(Closure), Array, ‘file’, ‘rename’)\n#9 /var/www/html/apps/files_versions/lib/Storage.php(297): OC\Files\View->rename(’/nikohk83/files…’, ‘/nikohk83/files…’)\n#10 /var/www/html/apps/files_versions/lib/Hooks.php(102): OCA\Files_Versions\Storage::renameOrCopy(‘Mindfield/Suppo…’, ‘Mindfield/Produ…’, ‘rename’)\n#11 /var/www/html/lib/private/legacy/hook.php(103): OCA\Files_Versions\Hooks::rename_hook(Array)\n#12 /var/www/html/lib/private/Files/View.php(904): OC_Hook::emit(‘OC_Filesystem’, ‘post_rename’, Array)\n#13 /var/www/html/lib/public/Events/EventEmitterTrait.php(50): OC\Files\View->OC\Files\{closure}( sensitive parameters replaced ***)\n#14 /var/www/html/lib/private/Files/View.php(919): OC\Files\View->emittingCall(Object(Closure), Array, ‘file’, ‘rename’)\n#15 /var/www/html/apps/dav/lib/Connector/Sabre/Directory.php(481): OC\Files\View->rename(’/Mindfield/Supp…’, ‘/Mindfield/Prod…’)\n#16 /var/www/html/lib/composer/sabre/dav/lib/DAV/Tree.php(160): OCA\DAV\Connector\Sabre\Directory->moveInto(‘Support’, ‘files/monika.be…’, Object(OCA\DAV\Connector\Sabre\Directory))\n#17 /var/www/html/lib/composer/sabre/dav/lib/DAV/CorePlugin.php(612): Sabre\DAV\Tree->move(‘files/monika.be…’, ‘files/monika.be…’)\n#18 /var/www/html/lib/composer/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\CorePlugin->httpMove(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#19 /var/www/html/lib/composer/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server->emit(‘method:MOVE’, Array)\n#20 /var/www/html/lib/composer/sabre/dav/lib/DAV/Server.php(253): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#21 /var/www/html/apps/dav/lib/Server.php(330): Sabre\DAV\Server->start()\n#22 /var/www/html/apps/dav/appinfo/v2/remote.php(31): OCA\DAV\Server->exec()\n#23 /var/www/html/remote.php(165): require_once(’/var/www/html/a…’)\n#24 {main}",“File”:"/var/www/html/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php",“Line”:129}

[message] => Exception: {“Exception”:“OCP\Files\NotFoundException”,“Message”:"/Mindfield/Support not found while trying to get owner",“Code”:0,“Trace”:"#0 /var/www/html/lib/private/Files/Filesystem.php(1072): OC\Files\View->getOwner(’/Mindfield/Supp…’)\n#1 /var/www/html/apps/files_versions/lib/Storage.php(94): OC\Files\Filesystem::getOwner(’/Mindfield/Supp…’)\n#2 /var/www/html/apps/files_versions/lib/Storage.php(124): OCA\Files_Versions\Storage::getUidAndFilename(’/Mindfield/Supp…’)\n#3 /var/www/html/apps/files_versions/lib/Hooks.php(149): OCA\Files_Versions\Storage::setSourcePathAndUser(’/Mindfield/Supp…’)\n#4 /var/www/html/lib/private/legacy/hook.php(103): OCA\Files_Versions\Hooks::pre_renameOrCopy_hook(Array)\n#5 /var/www/html/lib/private/Files/View.php(838): OC_Hook::emit(‘OC_Filesystem’, ‘rename’, Array)\n#6 /var/www/html/lib/public/Events/EventEmitterTrait.php(50): OC\Files\View->OC\Files\{closure}(*** sensitive parameters replaced ***)\n#7 /var/www/html/lib/private/Files/View.php(919): OC\Files\View->emittingCall(Object(Closure), Array, ‘file’, ‘rename’)\n#8 /var/www/html/apps/dav/lib/Connector/Sabre/Directory.php(481): OC\Files\View->rename(’/Mindfield/Supp…’, ‘/Mindfield/Prod…’)\n#9 /var/www/html/lib/composer/sabre/dav/lib/DAV/Tree.php(160): OCA\DAV\Connector\Sabre\Directory->moveInto(‘Support’, ‘files/monika.be…’, Object(OCA\DAV\Connector\Sabre\Directory))\n#10 /var/www/html/lib/composer/sabre/dav/lib/DAV/CorePlugin.php(612): Sabre\DAV\Tree->move(‘files/monika.be…’, ‘files/monika.be…’)\n#11 /var/www/html/lib/composer/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\CorePlugin->httpMove(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#12 /var/www/html/lib/composer/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server->emit(‘method:MOVE’, Array)\n#13 /var/www/html/lib/composer/sabre/dav/lib/DAV/Server.php(253): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#14 /var/www/html/apps/dav/lib/Server.php(330): Sabre\DAV\Server->start()\n#15 /var/www/html/apps/dav/appinfo/v2/remote.php(31): OCA\DAV\Server->exec()\n#16 /var/www/html/remote.php(165): require_once(’/var/www/html/a…’)\n#17 {main}",“File”:"/var/www/html/lib/private/Files/View.php",“Line”:1776}