Submitted by phaeronix on Sun, 08/10/2006 - 18:45.

I think everyone should know this, even if it gets people on my back for a while :P

Today morning was one of these days in which you wish you never woke up.

I was feeling very lazy, didn't want to do anything useful. Then I had a bright idea to update my avatar on eglug.org

Easy enough what could go wrong ? I prepared the image in the GIMP and opened my eglug user page, choose the picture and clicked save. or so I thought.

It seems that i clicked on delete by mistake. Then I didn't read the confirmation message assuming it is confirming the upload / overwrite of the avatar or something.

What followed were the most horrifying hours of my life ( well maybe not THE most , but definitely nerve racking ). My user was deleted, all my posts and comments were orphaned, effectively unpublished.

Thanks to the help of google , MSameer, abouyousef and diaa I was able to reverse the damage. It seems drupal just orphans content that was created by a deleted user. In drupal 4.7 the situation is worse because it assigns all orphaned content to user 0 ( anonymous ).

So all that was needed was an expert mysql insert, graciously provided by Msameer, to manually recreate the missing user. The information added by the insert was stored in the last backup I had. Then diaa reassigned me the user roles.

Lessons learned from this horror story :

  • always carefully read the message in front of you.
  • have recent backups.
  • have useful friends.
  • learn to use google.
  • learn to read the code.
  • Drupal is powerful, and flexible, but it can hurt you ( usually your fault ).
  • Revise your SQL every now and then, you never know when you will need it.

Also stand assured that I would have dealt with the manner in the same way if it was someone else.

I am off to the admin meeting now. I think I will write down minutes in this meeting.


Backups.

MSameer's picture

That's what I've been yelling about.


WWW: The place for organized randoms!

after you upgrade to 4.7

Alaa's picture

after you upgrade to 4.7 you might want to consider using orphaned_node module which allows you to pick the user who inherits orphaned nodes and comments (maybe create a special user ملجأ just for this).

cheers,
Alaa


husband of the Grand Waragi Master

http://www.manalaa.net

idea

phaeronix's picture

Maybe move deleted users to that shelter too, so they can be "resseructed". Also a deleted content would have the new owner assigned as a revision so on undleteing the user his content goes back to him. is this even remotely possible?

I don't know, that's why

Alaa's picture

I don't know, that's why we never delete users, we block them, only users who get deleted are spammers.

cheers,
Alaa


husband of the Grand Waragi Master

http://www.manalaa.net

Yes but a user can delet

MSameer's picture

Yes but a user can delet himself. This is the problem ?


WWW: The place for organized randoms!

can a user without

phaeronix's picture

can a user without privileges delete himself ?

AFAICT for 4.7 he can. I

MSameer's picture

AFAICT for 4.7 he can.

I had a look at the code but you can also review it.


WWW: The place for organized randoms!

much more useful to

Alaa's picture

much more useful to actually test it.

cheers,
Alaa


husband of the Grand Waragi Master

http://www.manalaa.net

nope an unprivileged user

Alaa's picture

nope an unprivileged user cannot delete herself. nd that applies to 4.7 too

cheers,
Alaa


husband of the Grand Waragi Master

http://www.manalaa.net

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.