Closed Bug 543115 Opened 16 years ago Closed 16 years ago

Import script erroneously deleted all accounts except Matthew's

Categories

(support.mozilla.org Graveyard :: Chat, defect)

defect
Not set
blocker

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: stephend, Assigned: paulc)

References

Details

Attachments

(1 file, 1 obsolete file)

While testing https://wiki.mozilla.org/Support/Live_Chat/SUMO_login/Testing, I noticed that the username I had just created via http://chat-support-stage.mozilla.com:9091/plugins/registration/sign-up.jsp wasn't being recognized. The reason, Matthew said in IRC, is that "the import script deleted every account, even those that could not be imported." This is blocking further testing. (Matthew will clarify.)
Summary: Import script erroneously deleted all account except Matthew's → Import script erroneously deleted all accounts except Matthew's
Which import script? Is this the script from bug 534351?
Target Milestone: --- → 1.5.1
(In reply to comment #1) > Which import script? Is this the script from bug 534351? Matthew? As per our Monday meeting, we were going to try to ship 1.5.1 tomorrow; do you have a status update? (We're not going to make it, so we should reset our ETA.)
I tested this script in various cases, but the behavior from staging only seems to be reproduced when TikiWiki accounts have empty ("") e-mail fields. After importing a clean copy of the Openfire and SUMO databases and upgrading to 1.5.1, running the script on sumotools resulted in only migrated accounts being deleted from Openfire. We should try this again, making sure staging has a clean unmodified copy of the production databases. I'm updating this script to check for any empty e-mail fields, and refuse to run if that's the case. I'll be posting that patch in the next few minutes, so that we can test it.
To clarify, empty e-mail accounts only resulted in about 500 additional accounts being removed. There were still ~1000 accounts left, in all cases, after the script had been run. The staging problem seems to have been caused by an incomplete database.
This patch reduces the number of deleted rows from ~500 to the apparently correct number of 321. All of the test accounts I used still existed after doing a test migration on sumotools. A number of Openfire accounts have whitespace-only e-mail addresses, which seemed to be causing extra migrations.
Attachment #425054 - Flags: review?(paulc)
Comment on attachment 425054 [details] [diff] [review] Match only valid e-mail addresses, with one '@' >+ email IS NOT NULL AND email != '' AND email LIKE '%@%'; While we're at it, we may as well validate that there's only one '@' and a dot. How about adding this: AND email REGEXP '[^@]+@[^@]+\\.[^@]+'; ... instead of: AND email LIKE '%@%'; On my test db, this excludes another few emails (4 emails, one e.g. is "vsimgak@live,ca") James or Laura: thoughts? Should we also check if the mail was successfully sent (mail() returns true)
Sounds good to me. Re mail(), it can't hurt (but the mail may still not be delivered, true just means it was accepted by the mail server).
Thanks Matthew for this. Since those accounts are erased, it's good to make sure emails are actually sent. This patch does that, plus some cleanup. Patch line 43 removes an unnecessary replace. Now, when the mail() function fails, the respective accounts are not deleted.
Assignee: bugs → paulc
Attachment #425054 - Attachment is obsolete: true
Attachment #425066 - Flags: review?(laura)
Attachment #425066 - Flags: review?(james)
Attachment #425054 - Flags: review?(paulc)
Comment on attachment 425066 [details] [diff] [review] match email with mysql regex + output failures failmail, lol
Attachment #425066 - Flags: review?(laura) → review+
(In reply to comment #9) > failmail, lol I spent years looking for a chance to use that name legitimately :) r61773. Time to verify remaining livechat bugs, I hope. Matthew, Stephend: what's next?
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Attachment #425066 - Flags: review?(james)
Next steps are to: * Have IT re-run the steps listed in the blocking bugs for bug 503215 * QA will then begin testing step-by-step, as per https://wiki.mozilla.org/Support/Live_Chat/SUMO_login/Testing; Matthew, we're going to need your help along the way, most likely.
Target Milestone: 1.5.1 → 1.5.2
Verified FIXED; Vishal and I have tested pretty thorough, and the testing included previously created, migrated accounts just fine.
Status: RESOLVED → VERIFIED
Product: support.mozilla.org → support.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: