Forums | Mahara Community

Support /
How to delete old institutions?


anonymous profile picture
Account deleted
Posts: 109

01 May 2014, 0:48

Hi,

We would like to fully delete some old, not used, institutions - how do we go about doing this?

So not only suspending but actually deleting.

Best regards,

Jonas

Tobias Zeuch's profile picture
Posts: 111

01 May 2014, 2:25

Hi Jonas,

I don't think there is any way in the frontend to delete an institution, so you would have to do this manually in the database. There are a couple of tables that reference institution, from some of which you have to overwrite the references and some of which you have to delete the responding lines from. Here's the list that I found when browsing through the database:

(From these tables, the reference to the corresponding field has to be set to NULL, prior to deleting the line from table institution. All fields are called 'institution'):

  • artefact
  • auth_instance
  • collection
  • favorite
  • group
  • host
  • view

From these tables, the corresponding lines have to be removed. Again it's field institution, with exception of table institution_locked_profile, where the field is name, and institution_registration_data, which corresponds to institution_registration (and you have to delete the data-table prior to institution_registration)

  • usr_custom_layout
  • institution_config
  • institution_locked_profile_field
  • institution_registration_data
  • institution_registration
  • site_content
  • usr_institution
  • usr_institution_request
  • usr_registration

And with this table, I'm not exactly sure. The field may be NULL but I'm not sure if there are any entries with more than one of the fields set. So I'd try to set the institution-flag to NULL and delete any entry that remains without any reference:

  • view_access

 

On the other hand, if you cleared all members from the institution and removed all authentication-methods, you could just give it a try and delete the institution from the institution-table. MYSQL will tell you which Constraints you have to clear first but most of the above tables should be cleared already. 

Any way, I do recommend making a copy of the installation, creating an SQL-Script to delete all entries accordingly and testing everything thoroughly, before making another backup and applying the script to the actual database. 

Best,

Tobias

anonymous profile picture
Account deleted
Posts: 109

01 May 2014, 21:55

Thanks a lot Tobias for your thorough answer!!

Aaron Wells's profile picture
Posts: 896

01 May 2014, 13:09

Hi Jonas,

It actually is possible to delete an institution, but only if it has 0 members. When you're looking at the list of institutions on the  "Administration -> Institutions" page, you'll see a delete icon button next to the edit icon button for that institution. An easy way to check this out is by creating a new, empty institution, and then immediately deleting it.

So what you need to do is to move all the users out of that institution first. If you don't have too many users, you can do this manually from the "Administration -> Institutions -> Members" page. If you have a whole lot of users, it may be easier to move them using a direct database update. See my comment on this bug for which tables and columns to update: https://bugs.launchpad.net/mahara/+bug/1223810

Cheers,

Aaron

anonymous profile picture
Account deleted
Posts: 109

01 May 2014, 21:51

Thanks so very much Aaron!!

Jason Dong's profile picture
Posts: 33

18 July 2016, 19:40

Hi, Aaron,

     I removed all members from an old institution and the delete icon appeared. When I pressed the delete button, it came to a confirmation page. But when I chose Yes, the application just teminated(jumped out). I tried this several times. Please look into this problem and help me on this.

Best Regards

Jason

Ghada El-Zoghbi's profile picture
Posts: 122

19 July 2016, 0:39

Hi Jason,

Can you please provide the error messages that are generated in the apache log and on the screen?

Thanks,
Ghada
Kristina Hoeppner's profile picture
Posts: 4729

19 July 2016, 6:52

Hello Jason,

Which version of Mahara do you use? You may need to update to the latest version (16.04) or at minimum download the latest security release for your version of Mahara. There was a problem with deleting institutions which I believe has been fixed recently.

Cheers

Kristina

 

Norman Mewes's profile picture
Posts: 5

15 April 2022, 8:10

Hi,

I'm on 21.04 and unable to delete  institutions as described by Jason years ago. After confirming the delete option I get error message "Site unavailable A nonrecoverable error occurred. This probably means you have encountered a bug in the system." Unfortunately I have access by frontend/GUI only. Any ideas how to solve this?

Cheers

Norman

Kristina Hoeppner's profile picture
Posts: 4729

19 April 2022, 13:55

Hi Norman,

Typically, there are two scenarios why you can't delete an institution:

  • People are still associated with it
  • An authentication method is still in use

If people are still associated with the institution, move them to another one. That also removes their authentication method that is associated with the institution.

If you use LTI, also delete the 'External app' for that institution.

If you then still get the error message, please ask a server administrator for the details and take it from there as there might be an edge case scenario in play.

Thank you

Kristina

10 results