Upgrading
Config Directory Migration (3.0.0)
Config Directory Migration (3.0.0)
Section titled “Config Directory Migration (3.0.0)”Overview
Section titled “Overview”In Wheels 3.0.0, we’ve made a significant change to improve the framework’s structure and make it more intuitive for developers. The configuration directory has been moved from /app/config to /config at the root level of your application.
Why This Change?
Section titled “Why This Change?”- Better Organization: Configuration files are now at the same level as the
/appdirectory, making them easier to find and manage - Industry Standards: This aligns with common conventions in modern web frameworks
- Clearer Separation: Application code (
/app) is now clearly separated from configuration (/config)
Breaking Change
Section titled “Breaking Change”This is a breaking change that requires action when upgrading to Wheels 3.0.0. Your application will not work correctly until you complete the migration.
What’s Changed
Section titled “What’s Changed”/app/config/→/config/- All configuration files (settings.cfm, routes.cfm, etc.) must be moved
- All references to the old path must be updated
Migration Methods
Section titled “Migration Methods”Method 1: Automated Migration (Recommended)
Section titled “Method 1: Automated Migration (Recommended)”We provide a CommandBox recipe that automates most of the migration process:
# From your application root directorybox recipe https://raw.githubusercontent.com/wheels-dev/wheels/develop/cli/recipes/config-migration.boxrThe recipe will:
- Back up any existing
/configdirectory - Move
/app/configto/config - Update your
Application.cfc - Scan for references to the old path
- Create a migration log
Method 2: Manual Migration
Section titled “Method 2: Manual Migration”If you prefer to migrate manually:
-
Move the config directory
Terminal window mv app/config config -
Update Application.cfc
Find and replace all occurrences of:
app/config/withconfig/app\config\withconfig\/app/configwith/config\app\configwith\config
-
Update your code
Search your entire codebase for references to
app/configand update them:Terminal window # Find all files with referencesgrep -r "app/config" app/ tests/ -
Update any custom scripts or deployment configurations
Common Files to Check
Section titled “Common Files to Check”Make sure to update references in:
Application.cfc- Custom initialization code
- Deployment scripts
- Documentation
- Test files
- Any hardcoded paths in your models, controllers, or views
Verification
Section titled “Verification”After migration, verify that:
- Your application starts without errors
- All configuration files are loaded correctly
- Routes are working as expected
- Database connections are established
- All tests pass
Rollback
Section titled “Rollback”If you need to rollback:
-
The automated recipe creates backups:
Application.cfc.bak- Your original Application.cfcconfig_backup_[timestamp]- Any existing /config directory
-
To rollback manually:
Terminal window # Move config backmv config app/config# Restore Application.cfc from backupmv Application.cfc.bak Application.cfc
Troubleshooting
Section titled “Troubleshooting”Application Won’t Start
Section titled “Application Won’t Start”- Ensure
/configdirectory exists at the root level - Check that all
.cfmfiles were moved from/app/config - Verify Application.cfc has been updated
- Check for syntax errors in migrated configuration files
Routes Not Working
Section titled “Routes Not Working”- Confirm
/config/routes.cfmexists - Check for any hardcoded paths in your route definitions
- Verify the file permissions are correct (readable by your web server)
- Clear any route caching: add
?reload=trueto your URL
Missing Configuration
Section titled “Missing Configuration”- Ensure all files from
/app/configwere moved, including:/config/settings.cfm/config/routes.cfm/config/environment.cfm/config/app.cfm- All environment-specific folders (
development,testing,production,maintenance)
- Check for any custom configuration files you may have added
Tests Failing
Section titled “Tests Failing”- Update test setup files that reference the old config path
- Check test fixtures and helpers for hardcoded paths
- Ensure test database configurations are properly migrated
- Look for any
expandPath()calls that reference the old path
Docker/Container Issues
Section titled “Docker/Container Issues”- Update any Docker volume mounts from
/app/configto/config - Rebuild containers after making compose.yml changes
- Check container logs for configuration loading errors
Common Error Messages
Section titled “Common Error Messages”“Could not find route”
- This usually means
/config/routes.cfmis not being loaded - Check the Application.cfc mapping is correct
- Verify the file exists and has proper permissions
“Invalid datasource”
- Ensure
/config/settings.cfmcontains your datasource configuration - Check environment-specific settings files were migrated
“Component not found”
- This may indicate the config mapping in Application.cfc is incorrect
- Verify the mapping points to
/confignot/app/config
Additional Resources
Section titled “Additional Resources”Need Help?
Section titled “Need Help?”If you encounter issues during migration:
- Check the migration log (
config_migration.log) - Search existing issues on GitHub
- Ask for help in the Wheels Community