FileMaker data migration tool を使ってみた!(3)

2018年06月15日 10:00 AM

FileMaker 17


 

FileMaker v17 が発売されましたが、同時に FDS(FileMaker Developer Subscription) では、FileMaker data migration tool というツールが提供されました。

前回(FileMaker data migration tool を使ってみた!(2)) は、 この FileMaker data migration tool のオプションを確認しましたが、今回は、残りのオプションについても、検証してみます。

ちなみにこのあと出てくる SrcClonemigrated 用語は、それぞれ下記の意味で使用しています。

  • Src(データ移行元)
  • Clone(クローンファイル、データなしのコピー)
  • migrated(データ移行後)

 

 

■□ FileMaker data migration toolのオプション □■


 

FileMaker data migration tool とは、簡単に言うとデータ移行ツールです。
その際に、オプションを指定することで、実現できることがあります。

 

-target_path <target file path> (default is source path with ” migrated” added)
-force (overwrite existing target file)
-ignore_valuelists (use custom value lists from clone instead of source)
-ignore_accounts (use accounts and decryption key from clone instead of source)
-ignore_fonts (assume no font mapping required for field contents)
-v (verbose mode)
-q (quiet mode)

 

前回上の3つを確認したので、今回は残りの4つ、

-ignoreaccounts (use accounts and decryption key from clone instead of source)
-ignore
fonts (assume no font mapping required for field contents)
-v (verbose mode)
-q (quiet mode)

について確認してみたいと思います。

 

 

 

■□ -ignore_accounts □■


 

-ignore_accounts (use accounts and decryption key from clone instead of source) 
//ソースの代わりにクローンからアカウントと復号化キーを使用する

 

Src

 

Account アクセス権 パスワード メモ
admin [完全アクセス] なし デフォルト
Edit [データ入力のみ] edit

 

Clone

 

Account アクセス権 パスワード メモ
admin [完全アクセス] admin パスワードを設定
Edit Edit edit アクセス権を追加し変更してみた。
View [閲覧のみアクセス] view Srcにないアカウントを追加

 

 

上記のようなアカウントを持ったファイルを用意し、コマンドを実行してみました。

 

コマンド:-ignore_accountsを使用

 

./FMDataMigration  
-src_path /Users/<ユーザ名>/Desktop/MigrationTool/1Src/KEN_ALL.fmp12 
-clone_path /Users/<ユーザ名>/Desktop/MigrationTool/2Clone/KEN_ALL.fmp12 
-clone_account admin 
-clone_pwd admin 
-target_path /Users/<ユーザ名>/Desktop/MigrationTool/3Target/KEN_ALL.fmp12 
-ignore_accounts

結果:Migrated(-ignore_accountsを使用)

 

Account アクセス権 パスワード メモ
admin [完全アクセス] admin Cloneと同じ
Edit Edit edit Cloneと同じ
View [閲覧のみアクセス] view Cloneと同じ

 

コマンド:-ignore_accountsを不使用

 

./FMDataMigration  
-src_path /Users/<ユーザ名>/Desktop/MigrationTool/1Src/KEN_ALL.fmp12 
-clone_path /Users/<ユーザ名>/Desktop/MigrationTool/2Clone/KEN_ALL.fmp12 
-clone_account admin 
-clone_pwd admin 
-target_path /Users/<ユーザ名>/Desktop/MigrationTool/3Target/KEN_ALL.fmp12 
結果:Migrated(-ignore_accountsを不使用)

 

Account アクセス権 パスワード メモ
admin [完全アクセス] なし Srcと同じ
Edit [データ入力のみ] edit Srcと同じ。でもアクセス権セットは追加されていた。
確認できたこと

 

このオプションを使用すると、SrcかCloneのアカウントのどちらかを選ぶことができます。
でも、選べるのはアカウント情報のみで、アクセス権セット情報は、クローンのものが必ず優先されます。

 

 

 

■□ -ignore_fonts □■

 

-ignore_fonts (assume no font mapping required for field contents) 
//フィールドの内容にフォントマッピングが不要であると仮定する

 

どういうことかというと、フィールド内容に書式設定されていたフォント情報を不要と判断するオプションのようです。
確認してみます。

 

Src (一部フォントを明朝体に変更したSrcファイルを用意しました。)

 

 

コマンド:-ignore_fontsを使用

 

./FMDataMigration  
-src_path /Users/<ユーザ名>/Desktop/MigrationTool/1Src/KEN_ALL.fmp12 
-clone_path /Users/<ユーザ名>/Desktop/MigrationTool/2Clone/KEN_ALL.fmp12 
-clone_account admin 
-clone_pwd admin 
-target_path /Users/<ユーザ名>/Desktop/MigrationTool/3Target/KEN_ALL.fmp12 
-ignore_fonts 
結果:Migrated

 

 

 

確認できたこと

 

このオプションを使用すると、フィールド内の文字に、フォントが指定されている場合に、データ移行時にフォント書式を無効にしてくれるようです。
ただし、フォントサイズや文字色は、そのまま引き継がれます。

 

 

 

■□ -v (verbose mode), -q (quiet mode) □■

 

-v (verbose mode) 
//詳細な処理状況を表示する  

-q (quiet mode)
//処理状況を表示しない  

 

実際に指定して実行してみます。

 

 

コマンド:-v (verbose mode) を使用

 

./FMDataMigration  
-src_path /Users/<ユーザ名>/Desktop/MigrationTool/1Src/KEN_ALL.fmp12 
-clone_path /Users/<ユーザ名>/Desktop/MigrationTool/2Clone/KEN_ALL.fmp12 
-clone_account admin 
-clone_pwd admin 
-target_path /Users/<ユーザ名>/Desktop/MigrationTool/3Target/KEN_ALL.fmp12 
-v
結果:-v (verbose mode)

 

== Mapping source privileges to target privileges ==
  Matching source and target privilege set by the name "[Full Access]" and internal id
  Matching source and target privilege set by the name "[Data Entry Only]" and internal id
  Matching source and target privilege set by the name "[Read-Only Access]" and internal id
  Matching source privilege set "Edit3" and target privilege set "Edit" by internal id
  Account "[Guest]" not changed
  Account "Admin" not changed
  Account "Edit" not changed
 == Copying changed custom value lists ==
 == Analyzing font lists ==
  Adding font "MS-PMincho" entry to target file
 == Mapping source tables to target tables ==
  Matching source and target table by the name "テーブル" and internal id
 == Mapping fields in source table "テーブル" to target table "テーブル" ==
  Matching source and target field by the name "f1" and internal id
  Matching source and target field by the name "f2" and internal id
  Matching source and target field by the name "f3" and internal id
  Matching source and target field by the name "f4" and internal id
  Matching source and target field by the name "f5" and internal id
  Matching source and target field by the name "f6" and internal id
  Matching source and target field by the name "f7" and internal id
  Matching source and target field by the name "f8" and internal id
  Matching source and target field by the name "f9" and internal id
  Matching source and target field by the name "f10" and internal id
  Matching source and target field by the name "f11" and internal id
  Matching source and target field by the name "f12" and internal id
  Matching source and target field by the name "f13" and internal id
  Matching source and target field by the name "f14" and internal id
  Matching source and target field by the name "f15" and internal id
  -- Fast migration for source table "テーブル" --
 == Summary ==
  Accounts migrated: 3
  Accounts changed: 0
  Custom value lists migrated: 0
  Font entries added: 1
  Tables migrated: 1
  Tables not migrated: 0
  Fields migrated: 15
  Fields not migrated: 0
  Fields triggering recalculations: 0
  Fields with evaluation errors: 0
  Fields with fewer repetitions: 0
  Serial numbers updated: 0



コマンド:-q (quiet mode)を使用

 

./FMDataMigration  
-src_path /Users/<ユーザ名>/Desktop/MigrationTool/1Src/KEN_ALL.fmp12 
-clone_path /Users/<ユーザ名>/Desktop/MigrationTool/2Clone/KEN_ALL.fmp12 
-clone_account admin 
-clone_pwd admin 
-target_path /Users/<ユーザ名>/Desktop/MigrationTool/3Target/KEN_ALL.fmp12 
-q

結果:-q (quiet mode)

 

なにも表示されませんでした。

 

 

確認できたこと

 

こちらのオプションは、処理状況を表示するかどうかだけですが、気をつけたいのは、-q (quiet mode)は、エラーすら表示しないことです。 例えば、-target_path に指定したファイルが既にあり、-force を指定していない場合、下記のようなエラーを表示します。

The target file couldn't be created because "(20406): File already exists."

 

-q (quiet mode) を指定していると、そのエラーすら表示しないので、成功したのかどうかすらわかりません。

 

■□ まとめ □■

 

FileMaker data migration tool は、開発時のデータ移行の内容をとても簡素化してくれます。
また、オプションを正しく指定することで、データ以外の内容もこのツールが自動で設定してくれます。
FDS(FileMaker Developer Subscription) を購入している方は、ぜひ活用してみてください。