Overview
Themigrate command handles automatic migration of configuration files and data structures when upgrading PicoClaw to a new version.
PicoClaw automatically runs migrations when it detects an older configuration format. You rarely need to run this command manually.
What Gets Migrated
The migrate command handles:- Legacy provider configuration - Converts old
providersformat to newmodel_listformat - Configuration schema changes - Updates config structure for new versions
- Workspace structure - Reorganizes workspace directories if needed
- Database schema - Updates SQLite databases (sessions, cron jobs, etc.)
When Migrations Run
Automatic Migration
PicoClaw automatically detects and runs migrations when:- Starting the agent or gateway
- Loading a configuration file with outdated format
- Accessing workspace data with old schema
Manual Migration
You can manually trigger migration with:- Testing migrations before production use
- Verifying configuration after manual edits
- Troubleshooting migration issues
Migration Examples
Legacy Providers → model_list
Before migration:Migration Safety
Backup created
Original config is backed up to
config.json.backup before migrationAtomic updates
Migrations are atomic - they either complete fully or roll back
Validation
Migrated config is validated before replacing the original
Reversible
You can restore from backup if migration causes issues
Troubleshooting
Migration failed
Migration failed
If migration fails:
- Check the backup file:
~/.picoclaw/config.json.backup - Review the error message for specific issues
- Restore from backup:
cp ~/.picoclaw/config.json.backup ~/.picoclaw/config.json - Fix the issue manually and try again
Configuration not recognized after migration
Configuration not recognized after migration
- Ensure you’re using the latest PicoClaw version
- Check the migration log for warnings
- Verify the new config format matches the documentation
- Run
picoclaw statusto validate configuration
Old config format still in use
Old config format still in use
- Migration may not have completed
- Run
picoclaw migratemanually - Check file permissions on config.json
- Ensure no other process is using the config file
Best Practices
- Backup before major upgrades - Create a manual backup of your config before upgrading PicoClaw
- Test in development - Test migrations in a development environment first
- Review changes - Check the migrated config to understand what changed
- Update custom scripts - If you have scripts that read config.json, update them for new format
Next Steps
Migration Guide
Detailed guide for migrating from legacy config format
Configuration
Learn about the new configuration format
Model Configuration
Understand the model_list configuration