<commit_before>---
title: Compacting the ServiceControl RavenDB database
summary: How to compact (release disk space to OS) the RavenDB database backing the ServiceControl
tags:
- ServiceControl
- RavenDB
---

##Step 1: Start ServiceControl in the maintenance mode
- Stop the ServiceControl Windows Service
- Open command line and go to ServiceControl binary folder
- Type `ServiceControl -maint`
- ServiceControl will start in the maintenance mode with all the features disabled and with RavenDB studio exposed on `http://localhost:33333/storage`

##Step 2: Export the current database
- Open a browser and navigate to `http://localhost:33333/storage`
- Export the existing ServiceControl database. 

![](ExportDatabase-Step1.PNG)

- Click Ok

![](ExportDatabase-Step2.PNG)

- Select the directory where you want to store the exported data file.

![](ExportDatabase-Step3.PNG)

- Wait for the export operation to complete.

![](ExportDatabase-Step4.PNG)

##Step 3: Delete the existing database<commit_msg>Clarifying ports<commit_after>---
title: Compacting the ServiceControl RavenDB database
summary: How to compact (release disk space to OS) the RavenDB database backing the ServiceControl
tags:
- ServiceControl
- RavenDB
---

##Step 1: Start ServiceControl in the maintenance mode
- Stop the ServiceControl Windows Service
- Open command line and go to ServiceControl binary folder
- Type `ServiceControl -maint`
- ServiceControl will start in the maintenance mode with all the features disabled and with RavenDB studio exposed on `http://localhost:{selected port}/storage` default this will be `http://localhost:33333/storage`

##Step 2: Export the current database
- Open a browser and navigate to `http://localhost:33333/storage`
- Export the existing ServiceControl database. 

![](ExportDatabase-Step1.PNG)

- Click Ok

![](ExportDatabase-Step2.PNG)

- Select the directory where you want to store the exported data file.

![](ExportDatabase-Step3.PNG)

- Wait for the export operation to complete.

![](ExportDatabase-Step4.PNG)

##Step 3: Delete the existing database
{'fraction_non_alphanumeric': 0.08321308321308321, 'fraction_numerical': 0.016354016354016353, 'mean_word_length': 4.761772853185596, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4924456', 'n_tokens_mistral': 582, 'n_tokens_neox': 527, 'n_words': 242}