Deletes all data belonging to a tenant from the core system, including all objects in repository, database, elasticsearch, audit entries and config files.
This command may be useful if all data of a tenant should be deleted. If you are going to use this command, you should consider that the tenant is already disabled for user login, to prevent any unexpected data manipulations while the deletion process is running. Be careful, this operation cannot be undone, nor is there any automatic data backup.
The command runs continuously, handling each day between the first object creation and the current day separately. Each day is splitted in a variable number of time periods, so the amount of objects to delete in each period is approximately equal to the number of fetch-size
. Then for each period the command is going to:
- collect all current version objects of the current day time period
- delete each repository item (separately)
- delete all elasticsearch objects (batch)
- delete all database rows (batch)
- collect all old version objects of the current day time period
- delete each repository item (separately)
- delete all database rows (batch)
After finishing all time periods for one day, all audit entires are going to be deleted. Depending on the number of objects for the tenant, this process can take a long time. While running the task, the process progress is continuously displayed including an estimated completion time. After handling all days, as last step the tenants configuration is going to be deleted.
The following parameters can be given to the maintain-tenant-data-delete
command:
Parameter | Argument Type | Description | Required | Default | Example |
---|---|---|---|---|---|
--tenant <arg> | string | Tenant for which all data should be deleted. | yes | - | --tenant default |
| string | Target directory for result log. | no | - | --target-directory C:\Users\myusername\ymtenantdeletionlog |
--fetch-size <arg> | int | Fetch size, used to split days in time periods. Each period contains approximate as many elements as the fetch-size is specified. The value must be at least 100 and not bigger than 10000. | no | 1000 | --fetch-size 500 |
--what-if | boolean | Setting this flag will prevent only simulate this command, by counting all documents that would be deleted without this flag | no | false | --what-if |
--skip-confirmation | boolean | Setting this flag will skip the initial warning, that all data is going to be deleted. | no | false | --skip-confirmation |
Example
In the following example, all objects of tenant default is going to be deleted. Each day is splitted in time periods which contains approximate 500 objects.
Lt. Commander>maintain-tenant-data-delete --tenant default --fetch-size 500 Running tenant delete job for 'default'
Any unexpected results will be continuously displayed while the process is running.