All settings reset and cleared

Today we discovered that all of the S2Member settings had been completely cleared. Looking at the tables, user data that had been added to custom fields was still there, but S2 has no sign we had been using it.

At this point I’m not sure exactly when the issue occurred. We had imported some users at the end of April (around April 21) and those users came in fine using an import tool. We had run a few Wordpress plugin updates in the last 2 weeks, but again, I can’t say for sure what may have happened.

Is there anything we can do to look for and restore the settings? We didn’t have an export of all the settings, so I don’t have that to fall back on. I’m looking at restoring the entire site to a previous version but then a lot of content has been posted since then and I don’t want to have to re-add it all.

Lastly, are there steps we can take to prevent this? I’m assuming either an error on the server caused this or maybe a conflict with another plugin, but I don’t know. Plugin deletion safeguards are enabled, by the way.

Thanks.

Do you keep a log of all the activity on your site? Something like the Activity Log plugin, for example? (There are several others.)

Because that sounds like someone has either reset everything to defaults, or has tried to restore your site from a backup already.

I checked the logs and they were empty, and as they say not to use on a live site, I wasn’t sure I should have them on anyway.

For resetting, how would someone reset the plugin? There are only two users who could do it, and I doubt they would have, but it would be good to know. And I am the only person who can restore the site, so that’s not likely either.

I should add that the site was transferred from a previous domain in late March. I used WP Migrate DB Pro, which seemed to work perfectly.

I wasn’t talking about the s2Member logs. They just monitor s2Member activity and, as you say, shouldn’t be active on a live site. I was taking about logs kept by a dedicated logging plugin. This is a great example of why it’s imperative to have one installed. Now you’re guessing instead of knowing what happened.

Only admins could reset stuff. But I think we now have a big clue:

I suspect it didn’t work quite as well as you thought. I’ve seen this happen when cloning via cPanel, and I guess you just experienced the same thing.

Good to know about a logging plugin. That said, in terms of the cloning, the settings were working as of at least April 26 when a new user was created in the new site. I added users that had custom profile field data. Something happened after that.

Considering user data is there for those custom profile fields, is there some place to check for s2Member setting data and possibly check it or fix it? Where would it be stored? wp_options table I assume?

I’m not sure I understand what you’re asking. s2Member being reset won’t affect the database. In any event, speculating about what happened is just that. s2Member doesn’t just reset itself. So install a logging plugin, set everything up again, and go from there. If it happens again (which I doubt) you’ll know why.

As I mentioned in my original post, I’m also wondering if there’s some way to look for the original s2Member settings in the MySQL tables. Or are settings completely overwritten?

Settings aren’t stored in tables.

I believe you are wrong.

All s2Member plugin options (even Pro options) are stored in the ws_plugin__s2member_options meta key in the wp_options table. This is a serialized associative array.
https://s2member.com/kb-article/where-is-the-s2member-data-stored-in-the-wordpress-database/

Those aren’t “settings.” As it says at the beginning of that post, “The s2Member plugin uses the WordPress database to store all data.” Note: data.

Are you messing with me? Where else would those settings be stored? A server file?

Settings work with files too. Otherwise, you would only need to move a database and not the plugins to go with it.

But if you’re so sure that everything is where you say it is, why are you asking here? You can simply take a look for yourself.

The s2M “settings” (not “data”) are saved in “wp_options” table as usual WP options. It is possible some other plugin (or theme), while upgrading, to delete these options, “thinking” it cleans “his own” options (using wrong regexp, as example). Not sure if a logging plugin will helps here, but nothing better can’t suggest…

Hmm, you made me look again. It turns out that s2Member saves BOTH data AND settings in the wp_options table. I have a lot of data (from custom fields) in there, and hadn’t noticed the other stuff that appears later. But you’re both right, the settings are there too.

Of course, that’s not going to help much if the only wp_options table to see is the one on the current site because, if all the stuff has been erased, it won’t be in the database anyway. That means going back to whatever WP Migrate DB Pro generated.

Moral: use at least two different methods to backup your site when migrate. :-/

mysqldump