ja:quickguides:migration_to_another_system

他のシステムへのマイグレーション

There can be many reasons for moving a PFMS server and its Web Console, which are generally on the same real machine or virtual machine (Pandora FMS monolith environment).

Pandora FMS サーバとその Web コンソールを移動する理由はさまざまですが、これらは通常、同じ実マシンまたは仮想マシン上にあります (単一の Pandora FMS 環境)。

Possible examples:

考えられる例:

  • A new version of Pandora FMS might require a different operating system, for example, migrating from CentOS 7 to Rocky Linux 8 or from Rocky Linux 8 to RedHat Enterprise (RHEL) 8.
  • It could also be the case of moving from one web service provider to another: Pandora FMS uses less data than the act of making an image of the entire operating system.
  • In the case of audits or to test new functionalities, it is necessary to have a copy of the main server.
  • Pandora FMS の新しいバージョンでは、たとえば、CentOS 7 から Rocky Linux 8 への移行、または Rocky Linux 8 から RedHat Enterprise (RHEL) 8 への移行など、別のオペレーティングシステムが必要になる場合があります。
  • ある Web サービスプロバイダーから別の Web サービスプロバイダーに移行する場合も考えられます。Pandora FMS の容量は、オペレーティングシステム全体のイメージよりも少ないです。
  • 監査の場合、または新しい機能をテストする場合は、メインサーバのコピーが必要です。

Usually the full path to the PFMS Web Console is

通常、Pandora FMS コンソールのフルパスは次の通りです。

/var/www/html/pandora_console

and in the following instructions it is abbreviated as $CONSOLE_PATH .

以下の手順では、$CONSOLE_PATH と記載します。

1.- Make a backup of the database of the previous system. There are several steps, open a terminal window with administrator rights (root user):

1.- 以前のシステムのデータベースのバックアップを取得します。いくつかのステップがあります。管理者権限(root ユーザ)でターミナルウインドウを開きます。

  • Start by making a logical copy of the database with the following command:
  • 次のコマンドでデータベースの論理的なコピーを作成します。
mysqldump --single-transaction --max_allowed_packet=512M -u root -p pandora> backup_pandora_X.Y.sql
  • The previous resulting file ( backup_pandora_X.Y.sql ) will be compressed with the following data in order to have a single file for the move. For example backup_pandora_X.Y.tar.gz , compressed format which preserves the intrinsic values of each file.
  • Compress all existing configuration files in the /etc/pandora/*.conf directory.
  • Zip the entire directory and subdirectories of $CONSOLE_PATH/attachment/ .
  • The custom images and icons in $CONSOLE_PATH/images/ , if any.
  • Zip the entire /var/spool/pandora/data_in/ directory.
  • Compress all the server plugin located in /usr/share/pandora_server/util/plugin/ . If they have one or more server plugins located in another directory that is not indicated, they must also be compressed.
  • Compress all dependencies installed on the source server, which are necessary for the proper functioning of scripts / plugins installed on the source server and are not on the destination server. Advanced systems will need to fully install the Integrated Development Environments ( or Integrated Development Environment, IDE ).
  • Compress all SSL certificates and custom Apache web server configuration located in /etc/httpd/ , if there are any such file(s).
  • 上記の出力ファイル (backup_pandora_X.Y.sql) は、移動用のファイルを作成するために圧縮します。たとえば、 backup_pandora_X.Y.tar.gz といった圧縮形式です。
  • /etc/pandora/*.confディレクトリ内のすべての設定ファイルを圧縮します。
  • $CONSOLE_PATH/attachment/ の全ディレクトリおよびサブディレクトリを圧縮します。
  • $CONSOLE_PATH/images/ のカスタム画像やアイコンがある場合は、それを圧縮します。
  • /var/spool/pandora/data_in/ ディレクトリ全体を圧縮します。
  • /usr/share/pandora_server/util/plugin/ にあるすべての サーバプラグイン を圧縮します。 別のディレクトリにもサーバプラグインがある場合は、それらも圧縮する必要があります。
  • 元サーバにインストールされているすべての依存ファイルを圧縮します。対象となる依存ファイルは、元サーバにインストールされているスクリプト/プラグインが適切に機能するために必要で、宛先サーバには存在しないものです。 高度なシステムでは、統合開発環境 (または IDE) を完全にインストールする必要がある可能性があります。
  • /etc/httpd/ にあるすべての SSL 証明書とカスタム Apache Web サーバ設定を圧縮します(そのようなファイルがある場合)。

You are solely responsible for the safeguarding of your data. Write down on paper and pencil the procedure you will choose for the data transfer. Be careful, use redundancy in terms of backups and procedures with several people helping you in the process.

データの保護はユーザのみなさん自身の責任です。データ転送のために選択する手順を紙と鉛筆で書き留めましょう。 バックアップや手順に関しては、複数の人が作業をサポートしてくれるような体制を確保するよう注意してください

2.- Install the new Pandora FMS system from scratch, we recommend the online installation tool.

2.- 新規で Pandora FMS システムをスクラッチからインストールします。オンラインインストールツールの利用をお勧めします。

3.- Close all processes running on the new system, except mysql; Start with Pandora FMS (starting with version NG 754, there are additional options for manual start and stop of HA High Availability Environments):

3.- mysql を除く、新しいシステムで実行中のすべてのプロセスを止めます。Pandora FMS から始めます (バージョン NG 754 以降、HA 高可用性環境の 手動起動および停止用の追加オプション があります):

  /etc/init.d/pandora_server stop
  /etc/init.d/pandora_agent_daemon stop
  /etc/init.d/tentacle_server stop

4.- To stop the Apache server will depend on the distribution you are using:

4.- Apache サーバの停止は、利用しているディストリビューションに依存します。

/etc/init.d/apache2 stop
/etc/init.d/httpd stop
systemctl stop httpd.service

5.- Next, send or copy, in the easiest way, the file backup_pandora_X.Y.tar.gz from the old system to the new one. Unzip the files in their corresponding places.

5.- 次に、旧システムから backup_pandora_X.Y.tar.gz を新システムに送信、コピーします。適当な場所でファイルを展開します。

6.- Enter mysql with root user. Access the Pandora FMS database in the new system, by default pandora and import the database.

6.- 新システムで、root で mysql へログインし、Pandora FMS データベースへアクセスします。デフォルトは pandora です。データベースにインポートします。

  # mysql -u root -p
  mysql>use pandora
  Database changed
  mysql>source ~/backup_pandora_X.Y.sql

This path will vary depending on the directory where you have the old system backup, here it is assumed that you have it in your home directory ($HOME).

このパスは、古いシステムのバックアップがあるディレクトリによって異なります。ここでは、ホームディレクトリ ($HOME) にバックアップがあるものと想定しています。

7.- In the event that it was a migration to a higher version, in which the structure of the database changes, this would be the moment of axisCut the migration scripts as indicated in major version upgrade procedure.

7.- データベースの構造が変更される新しいバージョンへの移行の場合は、メジャーバージョン に示されているように、このタイミングで移行スクリプトを実行します。

8.- If you have made a distribution change, take into account that the path or PATH of the Web Console has been modified and in this case there are some fields in the database that have also been changed. modified, such as the tconfig table and its attachment_store and fontpath fields. To modify these fields you must enter these instructions (query). The example is for a migration to Rocky Linux 8; in other distributions change the path of the Apache directory.

8.- ディストリビューションを変更した場合は、Web コンソールのパスが変更されていることを考慮してください。この場合、データベース内のいくつかのフィールドtconfig テーブルの attachment_store および fontpath フィールドなども変更します。これらのフィールドを変更するには、次のコマンド(クエリ)を入力する必要があります。 この例は、Rocky Linux 8 への移行の場合です。 他のディストリビューションでは、Apache ディレクトリのパスを変更します。

# mysql -u root -p> use pandora;
   Database changed> UPDATE tconfig SET value = '/var/www/html/pandora_console/attachment' WHERE token LIKE 'attachment_store';> UPDATE tconfig SET value = '/var/www/html/pandora_console/include/fonts/smallfont.ttf ' WHERE token LIKE 'fontpath';

These PATH must also be taken into account in the server and console configuration files (config.php and pandora_server.conf files).

これらのパスは、サーバおよびコンソールの設定ファイル(config.php および pandora_server.conf) でも考慮する必要があります。

9.- Once the database has been migrated, you must check if the files …/pandora_console/include/config.php and /etc/pandora/pandora_server.conf and the new ones they have the same data in the dbname, dbuser and dbpass fields.

9.- データベースのマイグレーションを行ったら、…/pandora_console/include/config.php および /etc/pandora/pandora_server.conf ファイルで、dbname, dbuser および dbpass フィールドの設定が同じであるか確認する必要があります。

  • If they are the same, go to step number 10.
  • If they are different, choose only one of the following options:
    • Option ( a ): Replace the new files with the old ones.
    • Option ( b ): Copy the data ( dbname, dbuser and dbpass ) from the old files to the new ones.
    • Option ( c ): Grant permissions to the database with the data from the new installation. Assuming that the new installation has these data: dbname=pandora, dbuser=pandora1 and dbpass=pandora2, the example takes the form:
  • 同じであれば、ステップ 1o へ行きます。
  • 異なるのであれば、いかのいずれかを選択します。
    • オプション(a): 古いファイルで新しいファイルを置き換える。
    • オプション(b): 古いファイルから、設定 ( dbname, dbuser および dbpass ) を新しいファイルへコピーする。
    • オプション©: 新たにインストールしたデータベースにアクセス許可を付与する。新たな設定で dbname=pandoradbuser=pandora1dbpass=pandora2 となっていると仮定すると、次の例の通りです。
# mysql -u root -p> grant all privileges on pandora.* to 'pandora1'@'localhost' identified by 'pandora2';> flush privileges;

10.- After this, start all the daemon again and you will be able to access the Pandora FMS Console, with all the Agents, Modules, alerts , etc.

10.- この後、すべての デーモン を再起動すると、すべてのエージェント、モジュール、アラートなどを備えた Pandora FMS コンソールにアクセスできるようになります。

11.- If the IP address or URL has changed in the new host, all local Agents will report to this new system. For Software Agents, you must modify the parameter server_ip in each of them.

11.- 新しいホストで IP アドレスまたは URL が変更された場合、すべての ローカル エージェントは、この新しいシステムに接続する必要があります。ソフトウェアエージェントの場合は、それぞれのパラメータ server_ip を変更する必要があります。

12.- Use, in Operaciones Masivas, editing agents to finalize any pending details.

12.- 最後の修正には、一括操作のエージェント編集 を利用します。

In the case of an Enterprise version, the same process will be followed.

Enterprise 版の場合も、同じ手順です。

  • ja/quickguides/migration_to_another_system.txt
  • 最終更新: 2023/07/27 05:51
  • by junichi