Overview
Themetadb upgrade command upgrades an existing Metadb instance to match the current version of the Metadb software. This command handles database schema changes, data migrations, and other version-specific updates.
Syntax
When to Use
Run the upgrade command:- After installing a new version of Metadb
- Before starting the server after a version update
- As part of your deployment process when updating Metadb
Options
Path to the Metadb data directory to upgrade.
Do not prompt for confirmation before starting the upgrade process.
Enable verbose output to see detailed upgrade progress.
Enable extremely verbose output for debugging (requires
METADB_DEV=on).Examples
Upgrade Process
When you run the upgrade command:- Metadb checks the current instance version
- Determines if upgrades are needed
- Applies necessary database schema changes
- Performs data migrations if required
- Updates configuration if needed
Typical Workflow
Standard Upgrade Procedure
Automated Upgrade Script
Upgrade Outcomes
Already Up to Date
If no upgrade is needed:Upgrade Applied
If changes were applied, you’ll see progress information about:- Schema modifications
- Data migrations
- Configuration updates
The upgrade process may take significant time depending on your database size and the changes required. The database generally remains available to users during most of the upgrade.
Database Availability
During the upgrade:- The Metadb server must be stopped
- The underlying PostgreSQL database typically remains available
- Most upgrade operations are performed at the database level
- Some long-running migrations may temporarily impact database performance
Best Practices
Before Upgrading
After Upgrading
Troubleshooting
Upgrade Fails
If the upgrade fails:- Check the error message - Look for specific issues reported
- Review logs - Check for detailed error information
- Verify database connectivity - Ensure PostgreSQL is accessible
- Check permissions - Verify the systemuser has necessary privileges
- Restore from backup - If needed, restore your backup and try again
Version Incompatibility
If upgrading from a very old version:- You may need to upgrade incrementally through intermediate versions
- Check release notes for migration paths
- Contact Metadb support for guidance
Long-Running Upgrades
For large databases:- Upgrade duration depends on data volume
- Monitor progress with
--verboseflag - Don’t interrupt the process
- Plan adequate maintenance windows
Rollback Procedure
If you need to rollback after an upgrade:Version Information
Check your current Metadb version:Additional Resources
- Review release notes for version-specific upgrade information
- Check the GitHub repository for known issues
- Backup the
metadb.conffile in your data directory
The upgrade command is idempotent - you can safely run it multiple times. If the instance is already up to date, no changes will be made.
