NextCloud sharing

Following upgrade from OwnCloud version 8 through 9, 10 and to NextCloud v12 to big surprise file/folder sharing option disappeared.

Same issue has been described here:

https://help.nextcloud.com/t/personal-settings-raises-error-cant-share-folder-with-other-users-group/22211

Throughout investigation showed that problem was somehow related to apps folder.

See at the bottom for solution.

For tests purposes below steps were taken:

  1. File sharing app happen to be on original install. By enabling it, as long as sharing was enabled in admin tab, files/folder view did show empty page whilst shared with me, showed nice list of shared with me folders.
    Further tests by disabling sharing in Admin -> Sharing panel: “Allow apps to use the Share API” resulted in nice view of files, but no shared folders/files were present.
    NOT OK – couldn’t get it working. Cleaning up DB manually didn’t help.
  2. Configure fresh installation of NextCloud (freshly downloaded, fresh database).
    OK – everything worked. This confirmed that at least vanilla version should work fine.
  3. Original installation DB backup was restored to new DB.
    Semi OK – some manual steps were needed, to repair installation and re-enable applications. Surprise was that file sharing app was required upgrade and was disabled.

The option 3 was the most promising and further tests were done if everything works fine.

Another element which was discovered was that shared folder ended up in my user main folder which was very inconvenient.

/config/config.php had set it to 'share_folder' => '/Shared',

Further checks of DB content revealed that there are entries pointing to my root folder. Modifying DB directly solved that problem and setting 'share_folder' => '/Shared/', solved issue for newly shared folder.

See my other post on how to update existing table for sharing. Update SQL entries

Solution

Steps to get production system working were:

  1. Put your system into maintenance mode. In my case I’ve blocked access to NextCloud installation based on source IP, to avoid production users interacting with system during maintenance work.
  2. Backup your NextCloud folder and DB.
  3. Install fresh NextCloud and restore config.php
  4. Move data folder.
  5. Don’t move/copy anything from apps folder.
  6. Repair system: ./occ maintenance:repair
  7. Re-enable all apps, especially files_sharing (v1.4.0).
  8. Disable maintenance.
  9. Upon first launch system will ask to upgrade missing applications and perform additional tasks. NextCloud downloads missing apps and updates them.
  10. Review if all apps are back and re-enabled.
  11. All should work fine
  12. Disable IP based filtering to allow production users to use the system.

 

Hope above helps as errors received didn’t make any sense to me.

Update SQL entries

Working on some other elements, I’ve run into need to update large number of elements within SQL table.

Below are examples how can it be done effectively.