I have a Joomla system (v3.8) which is running well.

Unfortunately, however, one of our administrator user record has accidentally been deleted. I need to restore it because we're now getting errors on pages on the site stating that this userID is missing, so there is obviously some cross-linked data that references it; probably the owner/creator of various content records. The user should have been deactivated rather than being deleted.

I have backups, but other DB changes have occurred in the interim that I don't want to lose, so I don't want to just restore the whole thing.

I've got a backed up copy up and running on a test box, and the user record is there, so it hasn't been lost.

What is the best way to go about restoring the record? Can I just grab the record from MySQL in the backup system and insert it verbatim back into live? Will this work? Is there any other linked data that I will need to restore as well?

Also, is there any way for me to prevent this mistake from happening again? We already had it in our user guide that user accounts should be deactivated and not deleted, but that was obviously ignored; is there a way to enforce it in Joomla not to delete users?

  • Unfortunately Joomla is missing the option "transfer content to a user" when deleting one (like wordpress does it). Just in case you really want to delete a user in the future, you have to reasign the content (articles for example) to a new user under the publishing tab in the article edit view. If you have a lot content to reasign, you could do some SQL magic in the database replacing every deprecated user_id with a new valid id via UPDATE command. Commented Mar 1, 2018 at 14:36

1 Answer 1


to fix this you can create a new user with the same privilage as the deleted user for example if superuser create user with superuser Privilage and then go to the id of it in the phpmyadmin and change it with the id of the deleted user https://www.screencast.com/t/Nj3T5hH8Vlfy (see it in the backup) ..

  • Yes, that does sound like the easiest option. Thanks. I'll give it a try and let you know how it goes.
    – Simba
    Commented Feb 22, 2018 at 15:31
  • 1
    Besides the #__users table you'll need to update the user_id from the #__user_usergroup_map table as well.
    – Drew G
    Commented Feb 22, 2018 at 21:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.