DBAtlas · データベース運用アトラス

アップグレード前の互換性/準備状況チェック

Oracle

-- Recommended method for 19c and later (AutoUpgrade analyze mode):
-- $ java -jar autoupgrade.jar -config db.cfg -mode analyze
-- Legacy/alternative: preupgrade script (produces a report only):
-- $ $NEW_ORACLE_HOME/jdk/bin/java -jar $NEW_ORACLE_HOME/rdbms/admin/preupgrade.jar FILE TEXT DIR /tmp

AutoUpgrade の 'analyze' モードは、データを変更せずにアップグレード前レポートを生成し、修正が必要な警告と自動的に解決される項目を一覧表示する。実際のアップグレードの前に必ず実行すること。

PostgreSQL

# With the new version's binaries, compatibility check only (moves no data):
$ pg_upgrade \
    --old-datadir=/var/lib/pgsql/16/data \
    --new-datadir=/var/lib/pgsql/17/data \
    --old-bindir=/usr/pgsql-16/bin \
    --new-bindir=/usr/pgsql-17/bin \
    --check

--check はデータを変更せずにアップグレードが可能かを検証する(不足している拡張、互換性のないデータ型などを報告する)。--check は旧クラスタの稼働中にも実行でき、実際のアップグレードは両方のクラスタを停止して行う。

MySQL

-- 8.0 and later: Upgrade Checker utility (MySQL Shell):
-- $ mysqlsh -- util check-for-server-upgrade { --user=root --host=localhost }
-- Table consistency for legacy 5.7->8.0:
$ mysqlcheck --all-databases --check-upgrade -u root -p

MySQL Shell の util.checkForServerUpgrade() は、削除された機能、予約語の衝突、互換性のない定義を報告する。8.0 以降はサーバーが起動時に自らディクショナリのアップグレードを行うため、個別の mysql_upgrade は不要になった。

SQL Server

-- Run from the desktop with Data Migration Assistant (DMA):
-- DmaCmd.exe /AssessmentName=... /AssessmentDatabases=...
-- (Produces compatibility/deprecated feature and blocker reports.)

Data Migration Assistant (DMA) は旧来の Upgrade Advisor に代わるもので、データベースごとに非推奨の機能、破壊的変更、ブロッカーを報告する。アップグレード前に実行し、検出事項を解決する。

MongoDB

// Verify the current Feature Compatibility Version (FCV):
db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })
// Compatibility items (deprecations) in the release notes are reviewed manually.

バイナリバージョンをアップグレードする前に、FCV が現在のバージョンと一致している必要がある。そうでないとアップグレードはブロックされる。MongoDB には自動の「非推奨スキャナ」がなく、リリースの互換性に関する注記を手動で確認する。

Redis

# Not applicable: Redis has no separate pre-upgrade readiness tool.
# Checklist: read the target version's release notes for RDB/AOF persistence format,
# changed configuration directives, and removed commands/arguments.

Redis のアップグレードは一般に前方互換。公式の準備状況スキャナはないため、RDB/AOF のファイル形式、削除された構成ディレクティブ、コマンドの変更をリリースノートで手動で確認する。

Elasticsearch

GET _migration/deprecations
# For a specific component: GET <index>/_migration/deprecations

Deprecation Info API は、次のメジャーバージョンへの移行時に問題となるクラスタ、ノード、インデックス、ML の設定を 'critical' / 'warning' として一覧表示する。Kibana Upgrade Assistant は同じデータを視覚化する。

DBAtlas で開く →