The CLI dbcleanup command
The Sitecore CLI Database Cleanup plugin performs database cleanup according to the provided tasks.
Warning
This command triggers a full cache cleanup, and it can cause performance degradation. It should be executed during a maintenance window.
Usage
The dbcleanup command requires elevated permissions.
You can use the dbcleanup command as follows:
bash
Options
The dbcleanup command has the following options:
--db <list-of-databases>, --database <list-of-databases>- Comma-separated list of databases targeted for cleanup tasks.--cf, --clean-fields- Clean up fields. Deletes data from shared, unversioned, and versioned fields that have no related items.--cof, --clean-orphanfields- Clean up orphaned fields. Cleans the field data from the orphans removed in items with no parent.--cb, --clean-blobs- Clean up blobs. Deletes blob fields that have no related field.-c, --config- Path to rootsitecore.configdirectory. Default: current working directory.-n, --environment-name- Named Sitecore environment to use. Default:default.-v, --verbose- Write some additional diagnostic and performance data.-t, --trace- Write more additional diagnostic and performance data.-?, -h, --help- Display developer help and usage information about the command.
Examples
The following examples show how to use the dbcleanup subcommand.
Run all cleanup tasks on all databases
Command:
bash
Result:
text
Run the clean-blobs task on the Master database
Command:
bash
Result:
text
If you have suggestions for improving this article, let us know!