3.3 KiB
3.3 KiB
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 managerAdminSearchController.java- Temporary admin endpoints for migrationTypesenseService.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:
@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<StorySearchDto> searchStories(...) {
return openSearchService.searchStories(...); // Direct call
}
// Remove all migration-related methods:
// - isDualWriteEnabled()
// - getMigrationStatus()
// - etc.
}
pom.xml
Remove Typesense dependency:
<!-- DELETE this dependency -->
<dependency>
<groupId>org.typesense</groupId>
<artifactId>typesense-java</artifactId>
<version>1.3.0</version>
</dependency>
application.yml
Remove migration configuration:
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:
# 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_KEYTYPESENSE_HOSTTYPESENSE_PORTTYPESENSE_ENABLEDSEARCH_ENGINESEARCH_DUAL_WRITE
✅ Configuration to KEEP (OpenSearch only)
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:
- Immediate: Restore from git:
git checkout HEAD~1 - Verify: Ensure application works with previous state
- Investigate: Fix issues in a separate branch
- 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