Accidentally deleted the entire nextcloud installation - config.php is gone - no backup

Hi community,

so after running nextcloud successfully for more than three years, I managed to delete my entire htdocs folder without a functioning backup (yeah, I know, no backup, no mercy).
So the config.php is gone and with it some crucial information (like instance-ID and the password-salt) to fully recover my nextcloud installation.

What I still have is all the uploaded data and the mariadb tables.

So I wonder what’s the best course of action here in order to restore as much as possible of my nextcloud? Do I have to do setup the nextcloud from scratch, create all the users again and then upload all the data again (it’s several hundred of gigabytes, so nothing I can do easily with my slow internet connection)? Or can I re-use some of the remaining stuff and if yes, how so?

Kind regards
StarWash

Does that mean, that your data folder is not deleted?

In that case, you have got backups from your htdocs folder in updater-$instanceid/backups

Yes, the data folder is fully intact because I had put that on a separate partition.
I’ve looked into the data folder but I cannot find any backups folder there. So I doubt I have that kind of backup available (although I did several updates of that nextcloud installation).

I did not say backups folder inside of data folder!

please READ:

So inside of your data folder is a folder with the name updater-$instanceid ($instanceid is that instanceid you think you lost) and inside of that folder, you wil find the backups folder.

I fully understood your first comment (thanks for your effort by the way).
But running find /mnt/www/nextcloud-data -type d -name "updater-*" yields no result as well as find /mnt/www/nextcloud-data -type d -name "backups"
So I’m quite sure I have ultimately lost my old config.php.

Last glimmer of hope:
maybe you can remember if you defined a special directory for the update directory back when you moved your data directory?

/**
 * Override where Nextcloud stores update files while updating. Useful in situations
 * where the default `datadirectory` is on network disk like NFS, or is otherwise
 * restricted. Defaults to the value of `datadirectory` if unset.
 *
 * The Web server user must have write access to this directory.
 */
'updatedirectory' => '',

I keep my fingers crossed for you

1 Like

Alright, I chose the “reinstall from scratch” option. Fortunately I could re-upload all the data with nextcloudcmd utility directly from the server. Nice tool but why does a command-line utility need to link to QT gui library?

Based on the includes, the dependencies from the Qt GUI library in the C++ sourcecode of nextcloudcmd are:

  • <QCoreApplication>: Part of the QtCore module, not the GUI module.
  • <QStringList>: Part of the QtCore module, not the GUI module.
  • <QUrl>: Part of the QtCore module, not the GUI module.
  • <QFile>: Part of the QtCore module, not the GUI module.
  • <QFileInfo>: Part of the QtCore module, not the GUI module.
  • <QJsonDocument>: Part of the QtCore module, not the GUI module.
  • <QJsonObject>: Part of the QtCore module, not the GUI module.
  • <QNetworkProxy>: Part of the QtCore module, not the GUI module.
  • <QDebug>: Part of the QtCore module, not the GUI module.

The Qt GUI library provides classes for building graphical user interfaces, but none of these includes are specific to the GUI module. They are mostly from the QtCore module, which provides the core functionality of the Qt framework.

If you want to use the GUI functionality of Qt, one need to include headers from the QtGui module, such as <QApplication>, <QWidget>, <QPushButton>, etc. However, none of these headers are included in the code of nextcloudcmd.

The #include <QObject> statement in cmd.h includes the header file for the QObject class, which is part of the QtCore module in the Qt library.

QObject is a fundamental class in Qt and serves as the base class for most Qt classes. It provides several features, including:

  • Object communication and event handling through the signal and slot mechanism.
  • Object introspection and reflection.
  • Support for properties, signals, and slots.
  • Memory management and object hierarchy.

While QObject is not directly related to the graphical user interface (GUI) functionality, it is a crucial component in Qt applications and is used extensively throughout the framework, including in GUI-related classes. It provides the foundation for many Qt features and facilitates communication and interaction between various parts of the application.

Therefore, while QObject itself is not a direct dependency of the Qt GUI library, it is an essential part of the overall Qt framework that supports GUI development.

Would you like a detailed, more thorough explanation?
I haven’t traced all includes yet but they are all linked only if needed. :wink:

Hey ernolf,

thank you very much for this thorough answer/explanation. Unfortunately it still leaves me confused because of this:

> ldd $(which nextcloudcmd) | grep -Fi gui  
        libQt5Gui.so.5 => /usr/lib64/libQt5Gui.so.5 (0x00007efdbb8cc000)