This guide provides step-by-step instructions for migrating from Dotbot to chezmoi on existing machines.
This migration is safe and reversible. Your existing dotfiles will not be modified until you explicitly apply the new configuration.
- Existing dotfiles managed by Dotbot
- Git installed
- Homebrew installed (macOS/Linux)
- Terminal access
Before starting, create a backup of your current dotfiles:
# Backup your home directory dotfiles
tar czf ~/dotfiles-backup-$(date +%Y%m%d).tar.gz \
~/.zshrc \
~/.tmux.conf \
~/.vimrc \
~/.gitconfig \
~/.gitconfig_private \
~/.config/starship.toml \
~/.config/git \
~/.config/k9s \
2>/dev/null
# Backup macOS-specific configs (if on macOS)
tar czf ~/dotfiles-macos-backup-$(date +%Y%m%d).tar.gz \
~/.config/karabiner \
~/.hammerspoon \
~/.config/ghostty \
2>/dev/null
echo "Backup created in home directory"# Install chezmoi
sh -c "$(curl -fsLS get.chezmoi.io)"
# Verify installation
chezmoi --versionOption A: Fresh start (recommended)
# Remove old dotfiles repository (don't worry, your dotfiles are still in ~/)
cd ~
rm -rf ~/dotfiles # or wherever your old dotfiles repo is
# Initialize chezmoi with the new repository
chezmoi init --apply litolsOption B: Keep old repository for reference
# Rename old repository
mv ~/dotfiles ~/dotfiles-old
# Initialize chezmoi with the new repository
chezmoi init --apply litolsIf you want to review what will change before applying:
# Initialize without applying
chezmoi init litols
# See what would change
chezmoi diff
# Review specific files
chezmoi cat ~/.zshrc
chezmoi cat ~/.gitconfig
# When ready, apply changes
chezmoi applyAfter applying, verify that your configurations are working:
# Test shell
zsh -c 'echo "Shell works: $SHELL"'
# Test git config
git config --global user.name
git config --global user.email
# Test starship (if installed)
starship --version
# Test mise (replacing asdf)
mise --versionIf you were using asdf, your .tool-versions files will continue to work with mise:
# Install mise (will be installed via Brewfile automatically, or manually:)
brew install mise
# Activate mise (already in new .zshrc)
mise activate zsh
# Verify your existing .tool-versions work
cd ~/your-project
mise install # Installs versions from .tool-versionsNote: You can keep both asdf and mise temporarily, then remove asdf when confident:
# After confirming mise works
brew uninstall asdf
rm -rf ~/.asdfIf you maintain separate work configurations:
# Set work profile environment variable
export WORK_PROFILE=true
# Re-initialize and apply
chezmoi init --apply litols
# Edit work-specific configs
chezmoi edit ~/.zshrc.d/work.zsh
chezmoi edit ~/.gitconfig_work
# Apply changes
chezmoi applyAdd to your .zshrc or .bash_profile on work machine:
# Add to ~/.zshrc (outside of chezmoi management)
export WORK_PROFILE=trueThe Brewfile will be automatically applied, but you can also run manually:
# Run brew bundle (automatically triggered by chezmoi)
# Or manually:
brew bundle --file ~/BrewfileKarabiner-Elements
# Karabiner config is automatically applied
# Launch Karabiner-Elements to activate
open -a "Karabiner-Elements"Hammerspoon
# Hammerspoon config is automatically applied
# Launch Hammerspoon to activate
open -a "Hammerspoon"Ghostty Terminal
# Config is at ~/.config/ghostty/config
# Launch Ghostty to use new config
open -a "Ghostty"Once you've verified everything works:
# Remove old dotfiles repository (if you renamed it)
rm -rf ~/dotfiles-old
# Remove any remaining Dotbot-related files
rm -rf ~/.dotbot # if it exists
# Remove old backups (after confirming everything works)
rm ~/dotfiles-backup-*.tar.gz
rm ~/dotfiles-macos-backup-*.tar.gzIf you previously maintained a separate work dotfiles repository:
- Note your work-specific configurations:
- Git user.name and user.email
- Work-specific aliases
- Work-specific environment variables
- SSH configs
- AWS configs
# Initialize with work profile
export WORK_PROFILE=true
chezmoi init litols
# Edit work configurations
chezmoi edit ~/.zshrc.d/work.zsh
# Add your work-specific aliases and env vars here
chezmoi edit ~/.gitconfig_work
# Add your work git config here, example:
# [user]
# name = Your Work Name
# email = you@company.com
# Apply changes
chezmoi apply~/.zshrc.d/work.zsh:
# Work-specific environment
export WORK_PROJECT_DIR=~/work
export AWS_PROFILE=work
# Work-specific aliases
alias work-ssh='ssh bastion.company.com'
alias work-vpn='sudo openconnect vpn.company.com'
# Work-specific PATH
export PATH="/opt/company/bin:$PATH"~/.gitconfig_work:
[user]
name = Your Name
email = your.name@company.com
[url "git@github-work:"]
insteadOf = git@github.com:If you need to rollback to Dotbot:
# Restore from backup
cd ~
tar xzf dotfiles-backup-YYYYMMDD.tar.gz
tar xzf dotfiles-macos-backup-YYYYMMDD.tar.gz
# Remove chezmoi
rm -rf ~/.local/share/chezmoi
brew uninstall chezmoi# Clone old dotfiles repository
cd ~
git clone https://github.com/litols/dotfiles ~/dotfiles-old
cd ~/dotfiles-old
git checkout <old-commit-before-migration>
# Run Dotbot install
./install
# Remove chezmoi
rm -rf ~/.local/share/chezmoi
brew uninstall chezmoiSymptoms: Missing aliases, PATH incorrect, commands not found
Solution:
# Check if .zshrc was applied
ls -la ~/.zshrc
# Verify chezmoi applied correctly
chezmoi verify
# Re-apply
chezmoi apply -v
# Check for errors
cat ~/.zshrc | head -20Symptoms: Git asking for username/email, wrong credentials
Solution:
# Check git config
git config --global --list
# Verify files exist
ls -la ~/.gitconfig
ls -la ~/.gitconfig_private
# Re-apply git configs
chezmoi apply ~/.gitconfig
chezmoi apply ~/.gitconfig_privateSymptoms: Work-specific settings not active
Solution:
# Ensure WORK_PROFILE is set
echo $WORK_PROFILE # Should output: true
# Check if work files exist
ls -la ~/.zshrc.d/work.zsh
ls -la ~/.gitconfig_work
# Re-initialize with work profile
export WORK_PROFILE=true
chezmoi init --apply litolsSymptoms: tmux plugins missing or not loading
Solution:
# Check tpm installation
ls -la ~/.tmux/plugins/tpm
# If missing, re-run chezmoi
chezmoi apply
# Install tmux plugins
tmux source ~/.tmux.conf
# Press prefix + I (capital i) in tmux to install pluginsSymptoms: mise: command not found or versions not loading
Solution:
# Ensure mise is installed
brew install mise
# Check mise activation in .zshrc
grep "mise activate" ~/.zshrc
# Restart shell
exec zsh
# Verify mise works
mise --version
mise list
# Install versions
cd ~/your-project
mise install| Aspect | Dotbot | chezmoi |
|---|---|---|
| File management | Symlinks | File copies |
| Templating | None (shell scripts) | Go templates |
| OS-specific configs | Shell conditionals | File suffixes (_darwin, _linux) |
| External deps | Git submodules | .chezmoiexternal.toml |
| Work/Personal | Separate repos | Single repo with profiles |
| Updates | git pull && ./install |
chezmoi update |
- All your configurations (zsh, tmux, vim, git)
- Homebrew package list
- Shell aliases and functions
- Key bindings and shortcuts
- Tool versions (now managed by mise instead of asdf)
- Single command updates:
chezmoi updatepulls and applies in one step - Work profile: Switch contexts without switching repos
- Better templating: OS detection, environment variables, conditionals
- Dry run: Preview changes before applying
- Encrypted secrets: Built-in secret management (not used yet, but available)
# Old way (Dotbot)
cd ~/dotfiles && git pull && ./install
# New way (chezmoi)
chezmoi update# Old way (Dotbot)
vim ~/dotfiles/zsh/.zshrc
cd ~/dotfiles && ./install
# New way (chezmoi)
chezmoi edit ~/.zshrc # Opens in $EDITOR, auto-applies on save
# Or manually:
chezmoi apply# Old way (Dotbot)
# Edit install.conf.yaml, add symlink, commit
# New way (chezmoi)
chezmoi add ~/.newconfig
cd $(chezmoi source-path)
git add .
git commit -m "Add newconfig"
git push- chezmoi docs: https://www.chezmoi.io/
- Repository issues: https://github.com/litols/dotfiles/issues
- Quick reference:
chezmoi help - See what will change:
chezmoi diff - Verify current state:
chezmoi verify
The migration process:
- ✅ Backup current configs
- ✅ Install chezmoi
- ✅ Initialize new repository
- ✅ Review changes (optional)
- ✅ Apply configuration
- ✅ Verify everything works
- ✅ Set up work profile (if needed)
- ✅ Clean up old Dotbot files
Estimated time: 15-30 minutes
Risk level: Low (fully reversible)
Recommended approach: Try on a non-critical machine first, then migrate your main machines.