Configuration Upgrade Assistant
December 28, 2025 ยท View on GitHub
The Blog Upgrade Assistant is an automated tool that helps you migrate your appsettings.json configuration files to the latest version when upgrading the blog to a new major version. This was introduced in version 12 of the blog. The update software tries to upgrade from version 11 to 12 automatically but not from earlier versions.
Why Use the Upgrade Assistant?
When upgrading the blog to a new major version, the configuration schema may change:
- New mandatory settings may be added
- Settings may be moved between sections
- Default values may change
The Upgrade Assistant automates these changes, reducing errors and making upgrades easier.
Quick Start
- Before upgrading, backup your configuration files (the tool also does this automatically)
- Navigate to your blog installation directory
- Run the upgrade assistant:
dotnet run --project tools/LinkDotNet.Blog.UpgradeAssistant - Review the changes and update any values as needed
- Complete any additional manual steps from MIGRATION.md
Installation
The tool is included with the blog source code in the tools/LinkDotNet.Blog.UpgradeAssistant directory. No separate installation is needed.
To build the tool:
cd tools/LinkDotNet.Blog.UpgradeAssistant
dotnet build
Usage Guide
Basic Migration
The simplest way to use the tool is to run it from your blog directory:
# Navigate to your blog installation
cd /path/to/your/blog
# Run the upgrade assistant
dotnet run --project tools/LinkDotNet.Blog.UpgradeAssistant
This will:
- Find all
appsettings*.jsonfiles in the current directory - Detect the current configuration version
- Apply all necessary migrations
- Save backups to
./backupsdirectory
Preview Changes (Dry Run)
To see what changes will be made without actually modifying files:
dotnet run --project tools/LinkDotNet.Blog.UpgradeAssistant -- --dry-run
The tool will display:
- Which migrations will be applied
- A preview of the modified configuration
- Warnings about new settings that require attention
Migrate Specific Files
To migrate a specific configuration file:
dotnet run --project tools/LinkDotNet.Blog.UpgradeAssistant -- --path /path/to/appsettings.Production.json
To migrate all files in a specific directory:
dotnet run --project tools/LinkDotNet.Blog.UpgradeAssistant -- --path /path/to/config
Custom Backup Location
By default, backups are saved to ./backups. To use a custom location:
dotnet run --project tools/LinkDotNet.Blog.UpgradeAssistant -- --backup-dir /path/to/backup/location
Understanding the Output
The tool uses color-coded output for clarity:
- ๐ข Green (Success): Operation completed successfully
- ๐ต Cyan (Info): Informational messages
- ๐ก Yellow (Warning): Warnings about settings that need attention
- ๐ด Red (Error): Errors that need to be resolved
- ๐ฃ Magenta (Headers): Section headers
Example Output
โโโ Blog Upgrade Assistant โโโ
โน Target: /path/to/blog
โน Backup directory: ./backups
โน Found 2 file(s) to process.
โโโ Processing: appsettings.json โโโ
โน Current version: Not set (pre-12.0)
โ Found 1 migration(s) to apply:
โ โข 11.0 โ 12.0: Adds ShowBuildInformation setting to control build information display.
โ Backup created: ./backups/appsettings_20251221_120000.json
โ Applying migration: 11.0 โ 12.0
โน Added 'ShowBuildInformation' setting. Controls display of build information in the footer.
โ Migration 11.0 โ 12.0 applied successfully.
...
โ File updated successfully: /path/to/blog/appsettings.json
โโโ Migration Complete โโโ
โ All files processed successfully!
How It Works
Version Detection
The tool looks for a ConfigVersion field in your appsettings.json:
{
"ConfigVersion": "12.0",
...
}
If this field doesn't exist, the tool assumes you're running version 11.0 or earlier and will apply all necessary migrations.
Migration Chain
The tool applies migrations sequentially:
- Detects current version (e.g., 12.0)
- Finds all migrations from current to latest (11.0โ12.0)
- Applies each migration in order
- Updates the
ConfigVersionfield to the latest version
Backup Process
Before making any changes, the tool:
- Creates a
backupsdirectory (or uses the specified backup location) - Copies each file with a timestamp:
appsettings_20241221_120000.json - Preserves the original file structure and formatting
Idempotency
The tool is idempotent - running it multiple times on the same file is safe:
- If no migrations are needed, no changes are made
- Already migrated files show "No migrations needed"
- Version tracking ensures migrations aren't applied twice
Migration Details
Changes:
- Adds
UseMultiAuthorModesetting (default:false)
After:
{
"UseMultiAuthorMode": false
}
Manual Steps Required:
- Set to
trueif you want multi-author support - Configure author information per blog post
Version 11.0 โ 12.0
Changes:
- Adds
ShowBuildInformationsetting (default:true)
After:
{
"ShowBuildInformation": true
}
Manual Steps Required:
- None (setting is optional)
Command-Line Reference
Usage: upgrade-assistant [options]
Options:
-p, --path <path> Path to appsettings.json file or directory
Defaults to current directory
-d, --dry-run Preview changes without applying them
-b, --backup-dir <path> Custom backup directory path
Defaults to './backups'
-h, --help Display help message
-v, --version Display tool version
Troubleshooting
"No appsettings.json files found"
Cause: Tool can't find configuration files in the specified location.
Solution:
# Specify the correct path
dotnet run --project tools/LinkDotNet.Blog.UpgradeAssistant -- --path /correct/path
"Invalid JSON in appsettings.json"
Cause: Your configuration file has JSON syntax errors.
Solution:
- Open the file in a JSON validator or editor
- Fix syntax errors (missing commas, brackets, etc.)
- Run the tool again
"Configuration is already up to date"
Cause: Your configuration is already at the latest version.
Solution: No action needed! Your configuration is current.
Migration Applied but Application Fails
Possible Causes:
- Database migrations not applied
- Custom configuration values need adjustment
- Environment-specific settings need updating
Solution:
- Check MIGRATION.md for additional manual steps
- Review application logs for specific errors
- Verify all required database tables exist
- Check environment-specific configuration files
Need to Revert Changes
Solution:
- Navigate to the backup directory (default:
./backups) - Find the backup file with the timestamp before migration
- Copy it back to your configuration location
- Restart the application
Example:
cp backups/appsettings_20251221_120000.json appsettings.json
Advanced Usage
Batch Processing
Process multiple configuration directories:
for dir in /path/to/blog1 /path/to/blog2 /path/to/blog3; do
dotnet run --project tools/LinkDotNet.Blog.UpgradeAssistant -- --path $dir
done
Automated CI/CD Integration
Include in your deployment pipeline:
# Example GitHub Actions workflow
- name: Upgrade Configuration
run: |
dotnet run --project tools/LinkDotNet.Blog.UpgradeAssistant \
--path ./deployment/config \
--backup-dir ./backups
Scripted Migration with Verification
#!/bin/bash
# Upgrade with verification
# Run dry-run first
dotnet run --project tools/LinkDotNet.Blog.UpgradeAssistant -- --dry-run --path ./config
# Ask for confirmation
read -p "Proceed with migration? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
# Run actual migration
dotnet run --project tools/LinkDotNet.Blog.UpgradeAssistant -- --path ./config
echo "Migration complete. Please review the changes."
fi
Additional Resources
- MIGRATION.md - Complete migration guide with manual steps
- Configuration Documentation - All configuration options
- Tool README - Developer documentation
Getting Help
If you encounter issues:
- Check this documentation and MIGRATION.md
- Review the tool's output messages - they often contain helpful information
- Open an issue on GitHub with:
- Tool output (with sensitive data removed)
- Your configuration version
- Error messages or unexpected behavior