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.
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.
- 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
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 buildThe 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.UpgradeAssistantThis will:
- Find all
appsettings*.jsonfiles in the current directory - Detect the current configuration version
- Apply all necessary migrations
- Save backups to
./backupsdirectory
To see what changes will be made without actually modifying files:
dotnet run --project tools/LinkDotNet.Blog.UpgradeAssistant -- --dry-runThe tool will display:
- Which migrations will be applied
- A preview of the modified configuration
- Warnings about new settings that require attention
To migrate a specific configuration file:
dotnet run --project tools/LinkDotNet.Blog.UpgradeAssistant -- --path /path/to/appsettings.Production.jsonTo migrate all files in a specific directory:
dotnet run --project tools/LinkDotNet.Blog.UpgradeAssistant -- --path /path/to/configBy default, backups are saved to ./backups. To use a custom location:
dotnet run --project tools/LinkDotNet.Blog.UpgradeAssistant -- --backup-dir /path/to/backup/locationThe 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
═══ 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!
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.
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
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
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
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
Changes:
- Adds
ShowBuildInformationsetting (default:true)
After:
{
"ShowBuildInformation": true
}Manual Steps Required:
- None (setting is optional)
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
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/pathCause: 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
Cause: Your configuration is already at the latest version.
Solution: No action needed! Your configuration is current.
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
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.jsonProcess 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
doneInclude 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#!/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- MIGRATION.md - Complete migration guide with manual steps
- Configuration Documentation - All configuration options
- Tool README - Developer documentation
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