# Search Engine Migration Cleanup Checklist **Use this checklist when removing Typesense and completing the migration to OpenSearch.** ## ๐Ÿ—‘๏ธ Files to DELETE Completely - [ ] `SearchMigrationManager.java` - Temporary migration manager - [ ] `AdminSearchController.java` - Temporary admin endpoints for migration - [ ] `TypesenseService.java` - Old search service (if exists) - [ ] `TypesenseConfig.java` - Old configuration (if exists) - [ ] Any frontend migration UI components ## ๐Ÿ”ง Files to MODIFY ### SearchServiceAdapter.java Replace delegation with direct OpenSearch calls: ```java @Service public class SearchServiceAdapter { @Autowired private OpenSearchService openSearchService; // Only this remains public void indexStory(Story story) { openSearchService.indexStory(story); // Direct call, no delegation } public SearchResultDto searchStories(...) { return openSearchService.searchStories(...); // Direct call } // Remove all migration-related methods: // - isDualWriteEnabled() // - getMigrationStatus() // - etc. } ``` ### pom.xml Remove Typesense dependency: ```xml org.typesense typesense-java 1.3.0 ``` ### application.yml Remove migration configuration: ```yaml storycove: search: # DELETE these lines: engine: opensearch dual-write: false # DELETE entire typesense section: typesense: api-key: xyz host: localhost port: 8108 # ... etc ``` ### docker-compose.yml Remove Typesense service: ```yaml # DELETE entire typesense service block typesense: image: typesense/typesense:0.25.1 # ... etc # DELETE typesense volume volumes: typesense_data: ``` ## ๐ŸŒ Environment Variables to REMOVE - [ ] `TYPESENSE_API_KEY` - [ ] `TYPESENSE_HOST` - [ ] `TYPESENSE_PORT` - [ ] `TYPESENSE_ENABLED` - [ ] `SEARCH_ENGINE` - [ ] `SEARCH_DUAL_WRITE` ## โœ… Configuration to KEEP (OpenSearch only) ```yaml storycove: opensearch: host: ${OPENSEARCH_HOST:localhost} port: ${OPENSEARCH_PORT:9200} # ... all OpenSearch config remains ``` ## ๐Ÿงช Testing After Cleanup - [ ] Compilation successful: `mvn compile` - [ ] All tests pass: `mvn test` - [ ] Application starts without errors - [ ] Search functionality works correctly - [ ] No references to Typesense in logs - [ ] Docker containers start without Typesense ## ๐Ÿ“ Estimated Cleanup Time **Total: ~30 minutes** - Delete files: 5 minutes - Update SearchServiceAdapter: 10 minutes - Remove configuration: 5 minutes - Testing: 10 minutes ## ๐Ÿšจ Rollback Plan (if needed) If issues arise during cleanup: 1. **Immediate:** Restore from git: `git checkout HEAD~1` 2. **Verify:** Ensure application works with previous state 3. **Investigate:** Fix issues in a separate branch 4. **Retry:** Complete cleanup when issues resolved ## โœจ Post-Cleanup Benefits - **Simpler codebase:** No dual-engine complexity - **Reduced dependencies:** Smaller build artifacts - **Better performance:** No dual-write overhead - **Easier maintenance:** Single search engine to manage - **Cleaner configuration:** Fewer environment variables --- **Created:** 2025-09-18 **Purpose:** Temporary migration assistance **Delete this file:** After cleanup is complete