Profile custom fields data not displaying in Dreamhost

I migrated the site from an AWS server using PHP 7.0 to DreamHost with PHP 7.4. The custom fields still show up on the Profile page and other lists using them. Also, their data is still present in options and user_metadata tables. But the fields all appear empty in the UI.

I’ve now done this on 2 different Dreamhost sites with same results.
I’ve tried resaving the s2member settings, deleting and reinstalling s2member. Unfortunately I’ve tried to reproduce the problem on a local PHP 7.4 server where I can use XDebug, but the problem does not happen there.
I then copied its DB to the Dreamhost DBs, but the fields on Dreamhost are still failing to show the data.

I have turned on both the WP debugging and the s2member debug logs. I’ve also checked the apache server logs. No errors are reported. Just the custom_field data is not being gathered and displayed.

Found the problem. It turns out that I have been consistently using the same DB table name prefix in all of my AWS and local databases. But the Dreamhost sites use a different prefix.

s2member adds the DB prefix to their user_metadata key names.
I’ve been using Backup-guard for the migrations, and it doesn’t know about the field names. I will need to add a custom command for it to include in the DB translations.

I kept looking at the data itself in the database, and didn’t notice that the meta_key was different.