TestRail Server 9.4 から、添付ファイルが格納される場所は Cassandra から Microsoft SQL Server に移行します。9.4 アップデートでは、既存の添付ファイルを Cassandra から MS SQL Server にコピーできる移行スクリプトが用意されています。元の Cassandra データはそのまま残ります。
※本ドキュメントの操作は TestRail 7.5 以降のバージョンから TestRail 9.4 にバージョンアップした場合だけ行います。
移行はいつでも都合のよいときに実行できます。ただし、次のリリース (TestRail 9.5) からは、移行が完了していることがアップグレードの条件になります。移行が完了していない場合、移行が完了するまで、TestRail 9.5 および以降のすべてのアップデートをインストールできません。
準備
Composer のインストール
Composer を利用してデータ移行用スクリプトの実行に必要なパッケージをインストールします。
TestRail のインストール環境に合わせて Composer をインストールしてください。
IIS サーバーとバックグラウンドタスクの停止
IIS サーバーおよびバックグラウンドタスクを停止します。
バックアップの取得
TestRail のファイルとデータベースのバックアップを作成します。
※v9.4.1 アップグレード作業前にバックアップを取得している場合でも、v9.4.1のアップグレード後のバックアップを再取得してください。
データ移行
移行に進む場合、手順は以下のとおりです。
-
- シェル (PowerShellなど) を開き、<TestRailインストールディレクトリ>\deprecation_script フォルダーに移動します。
- 以下のコマンドを実行して、Composer がインストールされ、正しく動作していることを確認します。
composer -V
Composer が起動していない場合は、 プロジェクトのドキュメント を参照して、インストール方法を確認してください。
- 次のコマンドを使用して必要な依存パッケージをインストールします。
composer update
- MS SQL Server データベースへの接続を確認します:
sqlcmd -S <host> -U username -P password
- Cassandra データベースへの接続を確認します:
cqlsh <host> 9042 -u <user> -p <password>
- (オプション) ドライランを実行して、移行スクリプトが動作していることを確認します:
php TestRailSqlToCassandraMigration.php -d2 -r -m"driver=sqlsrv;host=<host>;port=<port>;database=<database>;user=<user>;password=<password>" -s"host=<host>;port=9042;keyspace=<keyspace>;user=<user>;password=<password>" -v2 -b --attachments="<attachments location>"
- config.ini ファイルに入力し、データベースに接続するための認証情報を入力します (パスワードに特殊文字が含まれている場合は、二重引用符で囲みます)。
- config.ini ファイルに `driver = sqlsrv` の設定があることを確認します。(デフォルトで mysql が設定されているため、sqlsrv に変更します。)
- データベース(SQLServer および cassandra) の認証情報をインストール環境に合わせて変更してください。
- 前のステップがすべて正常に完了したら、次のコマンドで廃止スクリプトを実行します。
php TestRailCassandraDeprecation.php
- コマンド実行後、コンソールに出力される内容を確認してスクリプトの実行を進めます。
Welcome! We are about to start the Cassandra deprecation process. Please note that after deprecating Cassandra, our Team won't support downgrades to versions of TestRail with Cassandra. Do you still want to continue? Please type YES or NO. yes Please confirm the source and target databases: SOURCE: [Cassandra Information] Host: 127.0.0.1 Keyspace: testrail User: cassandra Port: 9042 TARGET: [SQL Information] Host: 127.0.0.1 Database Name: testrail User: testrail Port: 49884 Driver: sqlsrv Do you confirm? Please type YES or NO. yes The migration process may take a long time. So that we can notify you once it is completed, Would you like to configure an SMTP server before proceeding? no All ready to start Cassandra deprecation. The first step will be to migrate to the target database. This will be done in the background and may take a long time. Do you want to start? Please type YES or NO. yes
Apache Cassandra の停止
Cassandra から Microsoft SQL Server への移行が完了したら Cassandra を停止することができます。
古いファイルの削除
TestRailCassandraDeprecation.php スクリプトの実行後、古い添付ファイルを削除する必要があります。
詳細は 古い添付ファイルの削除 を確認してください。