Upgrading from Mender 2.0.1 to 2.7.1 - devices not shown in GUI (but 2.6.1 ok)

Recently we upgraded our old (2.0.1) self-hosted mender server from version to 2.6.1 successfully. The reason we couldn’t go to 2.7.x branch was that we just were unable make the GUI show us all the previously registered devices.

I have read several threads and tried different suggestions (for example specifying a 4.4.3 mongodb version), but nothing really seems to work here.

The upgrade process is as follows:

  • Follow the v2.7 production installation guide from the documentation to setup the server
  • Add the relevant configuration variables to prod.yml according to the guide
  • Copy the previously generated certificates & keys that we have
  • Restore old mongodb backup (using the restore-db command)
  • Perform the device re-sync as advised here (Mender 2.5.0 Problems with Filters, Hostnames and More - #2 by mzedel)

Accessing the deviceauth information directly via the API ({server-url}/api/management/v2/devauth/devices), I can confirm that all several thousand of our devices are seen via the API, but I don’t understand why this information does not appear on the GUI.
I also confirmed that when I configured one of our devices with the temporary development server, its authentication attempt is added to the database and I can see that as a new entry so the database connectivity seems working (the client gets not-authenticated message as a response).

These logs are from my development machine, and to speed up the process a bit I haven’t bothered restoring artifact data since that didn’t seem to affect 2.6.1 version in my testing

Please find my migration and device sync logs here:
mongo migration: mongodb restoration - Pastebin.com
resync log: deviceauth sync - Pastebin.com

Would appreciate some advice as I have no idea what to try next…

I continued investigating this further and noticed a peculiar thing. As I mentioned above, I was able to see new pending auth requests via the API. If I used API to accept the authentication of this device, it then showed up on the GUI immediately.

Also I noticed that if I run a custom script that cleans up all current “double auths” (DELETE .../devauth/devices/:device_mongoid/auth/:auth_id/status) and accept (PUT .../devauth/devices/:device_mongoid/auth/:auth_id/status ) any pending auths, I get 306 of our devices visible on the GUI and thats exactly the number of individual devices I update via the API

Maybe something is not going right in the device migration and some necessary link gets updated if you “manipulate the authentication data” via the API ?
I did notice another peculiar thing which I’m not sure is related. We have a custom serial number that we use as device identifier for our needs and I see now in the GUI that this serial parameter is not available as device identifier.