NC database table map - is there one?

Hi,

We migrated to NC 28 from an Owncloud 10.8.0 instance. After the update the LDAP user in our new NC instance are simply a mess. Some NC functions are able to find the LDAP users and some don’t, there are duplicates reported when using the “Search Users” feature.

I would like to know if there is a listing of the database tables that exist on NC and the purpose for each one. There are some tables that start with oc_ldap* but the documentation on LDAP is really poor.

Also, is there an expert that has done a similar migration from owncloud to nextcloud while using LDAP (AD) users?

Hi there, I just posted about my experience with LDAP after a major upgrade. Maybe it will help: Solutions to problems with LDAP table in SQL DB after upgrade

The main thing I found useful was to do

occ db:schema:expected > expected.txt
occ db:schema:export > actual.txt

…in order to get the current and expected DB layout, so I could adjust the DB to match what was needed.

I also did a fresh install of NC and did an SQL dump immediately after in order to get the correct table layout in SQL command form:

mysqldump \
--single-transaction \
--default-character-set=utf8mb4 \
--no-data \
-u root nextcloud \
 | tail +2 > "nc_db_layout.sql"

You can open the resulting file as text and copy the commands that built the tables you find don’t match what is expected.

Hope that helps.

2 Likes

oC 10.0.8 or 10.8?

And are you saying you tried to switch directly to Nc v28? That isn’t a supported migration path:

See Migrating from ownCloud.

Hi,

My bad, source was OwnCloud 10.8.0 (current production system on a VM). We cloned the VM on a test VM and then the test environment was upgraded to OwnCloud 10.13.0. From that point we were able to “upgrade” to Nextcloud 25 and we went to several NextCloud upgrades. Now we are at Nextcloud 28.0.14.

Thank you, your information was very helpful.
We have a half working NextCloud instance now. What doesn’t work very well at all is the infamous “Unified Search”. It will find guest and database users very fast but for LDAP users it will sometimes find them, sometimes it will crash and sometimes it will just give an empty result.
The user search in OwnCloud is very fast, it will search and find only LDAP users that have already logged in at least once, NextCloud in the other hand seems to search for all LDAP users defined in the Base DN and it will not be able to limit this search for actual NextCloud-LDAP users, this is really bad. Did you experience this same situation?

Hi Ivan, we have a small number of users and I don’t have a problem with searching. I would recommend making a group for the users you want to show up in Nextcloud and constraining the LDAP integration query just to that group. I don’t know how well that applies to your situation, but that’s all I can think of!