Commit af0b8950 authored by Kristina Hoeppner's avatar Kristina Hoeppner

admin/cli: Add user and group bulk deletion scripts

New in Mahara 18.10: You can delete users and groups
in bulk via CLI to clean up a site efficiently
(Bug #1768167 and Bug #1760767).
parent 5877895d
......@@ -10,6 +10,47 @@ Command-line interfaces (CLI)
Command-line interfaces (CLI) allow advanced users to interact with Mahara through the command line or terminal rather than through a graphical interface. That can speed up certain actions or make them easier to execute.
.. index::
single: CLI; Delete certain groups in bulk
single: New in Mahara 18.10; Delete certain groups in bulk via CLI
.. _cli_groupbulkdelete:
|new in Mahara 18.10| Delete certain groups in bulk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you have a large site and deleted a lot of users, you may also wish to clean up old groups in an efficient way. You can do the following with the bulk group deletion script:
* delete all groups that have no members, e.g. after users were deleted;
* and delete all groups that have only site administrators as members;
* and / or delete only groups associated with a certain institution.
Execute the script with the following command:
``sudo -u www-data php htdocs/admin/cli/delete_inactive_groups.php``
.. index::
single: CLI; Delete certain users in bulk
single: New in Mahara 18.10; Delete certain users in bulk via CLI
.. _cli_userbulkdelete:
|new in Mahara 18.10| Delete certain users in bulk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you want to delete users in bulk from the site without needing to go to the administration screen, especially if you have more than 500 users to delete, you can use CLI. This script allows you to do the following:
* delete all users that have never logged in, i.e. that were created manually, via CSV file, or an automated process;
* and / or delete all users that have not logged in since a certain date;
* and / or delete only those users from a specific institution;
* delete users that are members of a spefic group.
You can conduct a dry run first to ensure that only the correct people would be deleted.
Execute the script with the following command:
``sudo -u www-data php htdocs/admin/cli/delete_inactive_users.php``
.. index::
single: CLI; Index sites running Elasticsearch faster
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment