Nextcloud Fresh Install fails

NethServer Version: 7.7.1908
Module: nextcloud

I’m having issues with file modified dates so I wanted to do a fresh install of Nextcloud. I noticed that the DB and the nextcloud config was not being removed when doing an Uninstall from the UI.

Based on feedback here:

I did the following:

  • Uninstall Nextcloud from the UI
  • Remove the packages: yum remove nethserver-nextcloud nextcloud
  • Drop the database: mysql -e "drop database nextcloud"
  • Remove the whole NC directory: rm -rf /usr/share/nextcloud/
  • Remove the e-smith DB config config delete nextcloud
  • Try to Re-Install NC through the web page

It says:

The following command has failed:
system-packages/update

I run the command it gives me and that produces this log:

{
“state”: “running”,
“steps”: -1,
“event”: “Initialization”
}
{
“state”: “running”,
“steps”: -1,
“event”: “Resolving RPM dependencies”
}
{
“state”: “running”,
“steps”: -1,
“event”: “Downloading Packages”
}
{
“state”: “running”,
“steps”: -1,
“event”: “Running Test Transaction”
}
{
“state”: “running”,
“steps”: -1,
“event”: “Running Transaction”
}
{
“status”: “success”,
“steps”: -1,
“event”: “Transaction end”
}
{
“state”: “success”
}

If I try to log in to Nextcloud it is still at the setup and configuration step.

After this I noticed that there were also files here: /var/lib/nethserver/nextcloud

Removing these seemed to work. So the steps for a full clean install are:

  1. Uninstall Nextcloud using the admin page
  2. Remove the packages: yum remove nethserver-nextcloud nextcloud
  3. Drop the database: mysql -e "drop database nextcloud"
  4. Remove the whole NC directory: rm -rf /usr/share/nextcloud/
  5. Remove the e-smith DB: config delete nextcloud
  6. Remove the Nethserver config directory: rm -rf /var/lib/nethserver/nextcloud
  7. Install NC through the admin page
1 Like

Just remember nextcloud user data (files…) is saved under this directory. Usually there’s no need to remove it.

I noticed this. I can understand why they wouldn’t be removed automatically, but shouldn’t this be an option when uninstalling an app? Some people may assume that uninstalling the application will also remove all of the data for it. The same goes for the DB. I can understand why we wouldn’t always remove it (in case we need to fix Nextcloud with an uninstall/re-install), but it’s also a lot of extra work for someone who wants a clean slate.

This is the expected behaviour: there is not a cleanup script because users often uninstall/reinstall a package just to try to fix a problem and the do not want that all files deleted :smiley:

Since a complete removal is really a very uncommon case, we are not going to implement anything for it. But, if you think the information should be known, please open a PR on the README file to improve the developer manual: nethserver-nextcloud/README.rst at master · NethServer/nethserver-nextcloud · GitHub :wink:

Done :slight_smile:

1 Like

Thank you, the modification has been merged and the manual has been rebuilt: https://docs.nethserver.org/projects/nethserver-devel/en/latest/nethserver-nextcloud.html#full-reinstall