This guide helps you migrate between major versions of LUMOS, handling breaking changes and deprecated features.
LUMOS follows Semantic Versioning 2.0.0:
- MAJOR (x.0.0) - Breaking changes that require code updates
- MINOR (0.x.0) - New features, backwards compatible
- PATCH (0.0.x) - Bug fixes, backwards compatible
- Deprecation period: Features are deprecated for at least one minor version before removal
- Migration warnings: Deprecated features trigger warnings during generation
- Documentation: All breaking changes documented here with migration steps
| LUMOS Core | LUMOS CLI | Rust Target | TypeScript Target | Anchor | Borsh |
|---|---|---|---|---|---|
| v0.1.x | v0.1.x | 1.70+ | 5.0+ | 0.29+ | 1.0+ |
| v0.2.x | v0.2.x | 1.75+ | 5.0+ | 0.30+ | 1.5+ |
| v1.0.x | v1.0.x | 1.80+ | 5.5+ | 0.30+ | 2.0+ |
Note: Always use matching major.minor versions for lumos-core and lumos-cli.
Status: Not yet released - This section shows the template for future migrations
Impact: 🔴 High - Serialization compatibility broken Reason: Align with Anchor's enum representation for consistency
Before (v0.1.x):
#[solana]
enum GameState {
Active, // discriminant: 0
Paused, // discriminant: 1
Finished // discriminant: 2
}After (v0.2.x):
#[solana]
enum GameState {
Active, // discriminant: 1
Paused, // discriminant: 2
Finished // discriminant: 3
}Migration Steps:
- Backup: Save copies of all on-chain account data
- Regenerate: Run
lumos generatewith v0.2.x - Review: Check all generated enum discriminants
- Deploy: Re-deploy Solana programs (incompatible with old data)
- Migrate Data: Clear existing accounts or migrate data manually
- Update Clients: Deploy updated TypeScript SDKs
Automated Migration:
# This migration cannot be automated due to on-chain data incompatibility
# Manual data migration requiredImpact: 🟡 Medium - Code changes required
Reason: Consistency with Solana's Pubkey terminology
Before (v0.1.x):
struct Account {
owner: PublicKey,
}After (v0.2.x):
struct Account {
owner: Pubkey, // Renamed
}Migration Steps:
- Find and replace
PublicKey→Pubkeyin all.lumosfiles - Regenerate code
- No on-chain incompatibility (same underlying type)
Automated Migration:
# Find all occurrences
find . -name "*.lumos" -exec grep -l "PublicKey" {} \;
# Replace (review before applying)
find . -name "*.lumos" -exec sed -i '' 's/PublicKey/Pubkey/g' {} \;#[doc("Generated for {name}")] // New in v0.2.x
struct Account {
name: String,
}Migration: Optional - No action required for existing schemas
Status: Deprecated in v0.2.x, removed in v0.3.x
Replacement: Use Rust's native #[deprecated] in generated code
Before:
#[deprecated]
struct OldAccount {}After: Add deprecation manually in generated Rust code, or use documentation comments
- 🚀 30% faster code generation for large schemas (100+ types)
- 🚀 50% reduction in WASM bundle size with wasm-opt enabled
- 🚀 Improved string pre-allocation reduces memory allocations
Migration: Automatic - Rebuild your project to benefit
Before deploying migrated code to production:
- Read full migration guide for your version jump
- Backup all on-chain account data
- Note all breaking changes affecting your schemas
- Review deprecation warnings in current version
- Tag current deployment in version control
- Update
Cargo.tomlversions forlumos-coreandlumos-cli - Run
lumos generateon all schema files - Review all generated code diffs
- Update integration tests
- Test serialization compatibility (if applicable)
- Run full test suite
- Verify generated Rust compiles without warnings
- Verify generated TypeScript type-checks correctly
- Test Borsh serialization round-trips
- Deploy to devnet/testnet first
- Monitor for runtime errors
- Update client SDKs if needed
Problem: Breaking change requires program re-deployment
Solution:
- Deploy new program with different program ID
- Migrate user data to new accounts
- Update frontend to use new program ID
- Deprecate old program gracefully
Problem: Need to migrate all schemas consistently
Solution:
# Regenerate all schemas in workspace
find . -name "*.lumos" -exec lumos generate {} \;
# Or use workspace-level script
./scripts/regenerate-all.shProblem: Cannot migrate entire codebase at once
Solution:
- Keep both v0.1.x and v0.2.x schemas temporarily
- Use different file extensions (
.lumosvs.lumos2) - Migrate module-by-module
- Remove old schemas after full migration
If migration fails, roll back safely:
- Restore schemas from version control
- Downgrade LUMOS to previous version
- Regenerate code with old version
- Restore deployments from backup
- Investigate failure before retrying
# Restore specific version
cargo install lumos-cli --version 0.1.0
# Regenerate with specific version
lumos generate schema.lumos
# Verify version
lumos --versionIf you encounter migration issues:
- Check this guide for your specific version transition
- Search issues: https://github.com/getlumos/lumos/issues
- Ask community: Discord/GitHub Discussions
- Report bugs: Create detailed issue with:
- Source version
- Target version
- Minimal reproduction schema
- Error messages
For LUMOS maintainers planning breaking changes:
- Discuss in GitHub issue
- Document deprecation warnings
- Update this migration guide
- Add migration tests
- Update CHANGELOG.md
- Add deprecation warning in v0.x.0
- Keep feature working with warning
- Remove in v0.(x+2).0 (skip one minor version)
- Document alternative approach
- Announce breaking changes in release notes
- Update migration guide before release
- Post migration examples in discussions
- Update documentation site
Last Updated: 2025-11-21 Current Version: v0.1.x Next Major Version: v1.0.0 (planned)