Accidentially deleted datadirectory

Hello,

during an OS change, I missed to backup datadirectory. My Nextcloud is working, I can log in and see my calendar and contacts, but obviously, the Files are missing.

This is not a bigger problem because I have copies of all files on my clients and in backups of the clients. Of course, the old versions will be lost, I don’t care.

But I wonder how to get the files section back working. What would be the best strategy? After clicking around a little, die files section seems to work again “no files available”. Can I now safely connect a client and re-upload everything?

I would avoid it and try to backup everything on external drives. It’s not a standard procedure and it’s hard to predict the exact behavior of the client.

What I would try:

  • backup data on external disk, verify backup then disconnect the drive
  • copy all files from sync folder on a local folder
  • restart the client, let it sync again
  • once the client is synced with nothing (worst case delete and add sync point again with no data)
  • with the client running and synced, copy back the files in the sync folder
  • client should sync again the files to the server

Make sure that other clients don’t mess up the process. If they are connected with app passwords, you can revoke the app passwords. And then slowly adding client per client.

1 Like

Worked like a charm! No data lost, except old versions. Hooray! :smiley:

When accessing admins settings, I receive this

{“reqId”:“pNlm3xvoYsKdeHTRivyx”,“level”:3,“time”:“2022-10-19T22:04:44+02:00”,“remoteAddr”:“192.168.170.35”,“user”:“admin”,“app”:“index”,“method”:“GET”,“url”:“/settings/user”,“message”:“”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Firefox/105.0”,“version”:“24.0.6.1”,“exception”:{“Exception”:“OCP\Files\NotFoundException”,“Message”:“”,“Code”:0,“Trace”:[{“file”:“/var/www/nextcloud/apps/settings/lib/Settings/Personal/PersonalInfo.php”,“line”:131,“function”:“getStorageInfo”,“class”:“OC_Helper”,“type”:“::”,“args”:[“/”]},{“file”:“/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php”,“line”:129,“function”:“getForm”,“class”:“OCA\Settings\Settings\Personal\PersonalInfo”,“type”:“->”,“args”:},{“file”:“/var/www/nextcloud/apps/settings/lib/Controller/PersonalSettingsController.php”,“line”:73,“function”:“formatSettings”,“class”:“OCA\Settings\Controller\PersonalSettingsController”,“type”:“->”,“args”:[[[{“class”:“OCA\Settings\Settings\Personal\PersonalInfo”}],[{“class”:“OCA\Settings\Settings\Personal\ServerDevNotice”}]]]},{“file”:“/var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php”,“line”:140,“function”:“getSettings”,“class”:“OCA\Settings\Controller\PersonalSettingsController”,“type”:“->”,“args”:[“personal-info”]},{“file”:“/var/www/nextcloud/apps/settings/lib/Controller/PersonalSettingsController.php”,“line”:64,“function”:“getIndexResponse”,“class”:“OCA\Settings\Controller\PersonalSettingsController”,“type”:“->”,“args”:[“personal”,“personal-info”]},{“file”:“/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:225,“function”:“index”,“class”:“OCA\Settings\Controller\PersonalSettingsController”,“type”:“->”,“args”:[“personal-info”]},{“file”:“/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:133,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”,“args”:[{“class”:“OCA\Settings\Controller\PersonalSettingsController”},“index”]},{“file”:“/var/www/nextcloud/lib/private/AppFramework/App.php”,“line”:172,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”,“args”:[{“class”:“OCA\Settings\Controller\PersonalSettingsController”},“index”]},{“file”:“/var/www/nextcloud/lib/private/Route/Router.php”,“line”:298,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:“::”,“args”:[“OCA\Settings\Controller\PersonalSettingsController”,“index”,{“class”:“OC\AppFramework\DependencyInjection\DIContainer”},[“personal-info”,“settings.PersonalSettings.index”]]},{“file”:“/var/www/nextcloud/lib/base.php”,“line”:1030,“function”:“match”,“class”:“OC\Route\Router”,“type”:“->”,“args”:[“/settings/user”]},{“file”:“/var/www/nextcloud/index.php”,“line”:36,“function”:“handleRequest”,“class”:“OC”,“type”:“::”,“args”:}],“File”:“/var/www/nextcloud/lib/private/legacy/OC_Helper.php”,“Line”:510,“CustomMessage”:“–”}}

What could I do to fix this?

My personal users settings work.

Solved this by adding a new user with group admin with the occ tool. Then disabling the original admin account.

Plus, it’s more sucure because hackers always attack the admin account. :innocent: