Skip to content

Commit 0d19e83

Browse files
fix: remove os data as part of reset (#1983)
* remove os data * review comments
1 parent 4694a09 commit 0d19e83

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ make clear-os-data # Clear OpenSearch data directory completely
262262
make factory-reset # Complete reset: containers, volumes, and data
263263
```
264264

265+
The reset also removes any legacy `opensearch-data` directory, so old OpenSearch index files do not linger after cleanup.
266+
265267
---
266268

267269
## Makefile Help System

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@ factory-reset: ## Complete reset (stop, remove volumes, clear data, remove image
591591
echo " - Delete langflow-data directory"; \
592592
echo " - Delete config directory"; \
593593
echo " - Delete data directory (database and session configs)"; \
594+
echo " - Delete opensearch-data directory (legacy OpenSearch bind-mount data)"; \
594595
echo " - Delete JWT keys (private_key.pem, public_key.pem)"; \
595596
echo " - Remove OpenRAG images"; \
596597
echo ""; \
@@ -621,6 +622,14 @@ factory-reset: ## Complete reset (stop, remove volumes, clear data, remove image
621622
rm -rf data; \
622623
echo "$(PURPLE)data removed$(NC)"; \
623624
fi; \
625+
if [ -d "opensearch-data" ]; then \
626+
echo "Removing opensearch-data..."; \
627+
if rm -rf opensearch-data; then \
628+
echo "$(PURPLE)opensearch-data removed$(NC)"; \
629+
else \
630+
echo "$(RED)Warning: Failed to remove opensearch-data (check permissions)$(NC)"; \
631+
fi; \
632+
fi; \
624633
if [ -n "$$OPENRAG_DATA_PATH" ] && [ -d "$$OPENRAG_DATA_PATH" ]; then \
625634
echo "Removing $$OPENRAG_DATA_PATH..."; \
626635
rm -rf "$$OPENRAG_DATA_PATH"; \

docs/docs/_partial-factory-reset-warning.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This is a destructive operation that does the following:
44
* Destroys all OpenRAG containers, volumes, and local images.
55
* Prunes any additional container objects.
66
* Deletes the contents of the `~/.openrag` directory _except_ for OpenRAG's `.env` file and the `/documents` subdirectory.
7+
* Removes any legacy `opensearch-data` directory so old index data does not survive a reset.
78

89
<p/>Destroyed containers and deleted data are lost and cannot be recovered after running this operation.
910
:::
@@ -19,4 +20,4 @@ Neither <br/> nor wrapping the entire line in <p> </p> worked consistently for b
1920
Either the line break was missing or the indentation was incorrect.
2021

2122
This behavior was observed in Docusaurus 3.9.2 on 05 Dec 2025. In a future release, if this is not longer an issue, you can remove the tag and this note. :)
22-
-->
23+
-->

0 commit comments

Comments
 (0)