Skip to main content
The donkey update command updates your car’s core files (manage.py, config.py, etc.) to match the latest version of the Donkeycar templates.

Usage

This command overwrites files! Your myconfig.py is safe, but manage.py, config.py, train.py, and calibrate.py will be replaced with the latest versions from the template.

Arguments

string
default:"complete"
Name of the template to update from. Options: complete, basic, path_follow, cv_control, simulator

Description

When you update the Donkeycar library with pip install --upgrade donkeycar, your car application files don’t automatically update. The update command synchronizes your car files with the newer template. What gets updated:
  • manage.py - Main vehicle script
  • config.py - Default configuration
  • train.py - Training script
  • calibrate.py - Calibration script
What stays safe:
  • myconfig.py - Your custom settings (never overwritten)
  • data/ - Your training data
  • models/ - Your trained models
  • logs/ - Log files

When to Use Update

Run donkey update when:
  1. After upgrading Donkeycar - Sync your car to use new features
  2. Breaking changes in new version - Ensure compatibility
  3. Bug fixes in templates - Get fixes to vehicle loop, data collection, etc.
  4. New template features - Access new parts, modes, or capabilities
  5. Switching templates - Change from one template type to another

Example Usage

Update to Latest Complete Template

Switch from Basic to Complete Template

This will replace your basic template files with the full-featured complete template.

Update After Upgrading Donkeycar

How It Works

  1. Detects current directory - Must be run from your car directory (e.g., ~/mycar)
  2. Copies template files - Overwrites core files with --overwrite=True
  3. Preserves myconfig.py - Your customizations remain intact
  4. Preserves data - All data, models, and logs stay untouched

Before You Update

1

Backup your files

If you modified manage.py or other core files, back them up first:
2

Check your modifications

Review what you changed in core files:
3

Note your custom code

If you added custom parts or logic to manage.py, you’ll need to re-add them after the update.

After You Update

1

Review changes

Check what changed in the new files:
2

Merge custom code

If you had custom parts or modifications, add them back to the new manage.py.
3

Update myconfig.py if needed

New versions may add new config options. Check config.py for new settings and add them to myconfig.py if desired.
4

Test your car

Verify everything still works:

Best Practices

Use version control - Keep your car directory in git. This makes it easy to see what update changed and revert if needed:
Keep customizations in myconfig.py - Instead of modifying config.py, override settings in myconfig.py. This makes updates seamless.
Minimize manage.py changes - Put custom parts in separate files and import them, rather than editing manage.py directly.

Troubleshooting

You must run donkey update from inside your car directory:
If you had custom code in manage.py that got overwritten:
  1. Check your backup: manage.py.backup
  2. Or restore from git: git checkout HEAD~1 manage.py
  3. Manually merge your changes into the new file
  4. Consider putting custom parts in separate files next time
myconfig.py is never overwritten by update. New config options appear in config.py only. To use them:
  1. Open config.py and find the new settings
  2. Copy them to myconfig.py with your desired values
  3. Settings in myconfig.py override those in config.py
If your car won’t start after updating:
  1. Check for Python errors: python manage.py drive
  2. Verify virtual environment is activated
  3. Check that required parts are still available
  4. Review myconfig.py for incompatible settings
  5. Try rolling back: git checkout HEAD~1

Alternative: Manual Update

Instead of using donkey update, you can manually copy files from the Donkeycar templates:

Source Code

Implemented in donkeycar/management/base.py:143-157