Migration JSON Example

In the example below, two files are fetched from a Development Server at http://<otto-dev-server>, and a data migration is performed on both files.  Scroll down for more information on each section.

Example

{
  "concurrency": 5,
  "closeFileTimeoutSeconds" : 120,
  "tasks": [
    {
      "remote": {
        "fileName": "Contacts.fmp12",
        "url":
          "http://<otto-dev-server>:3030/api/file/download/Contacts",
        "auth": {
          "user": "admin",
          "pass": "<pass>",
        },
        "fms": { "clone": true }
      },
      "local": {
        "fileName": "Contacts.fmp12",
        "folder": {
          "fmsDBFolder": "other1",
          "subfolder": "CRM"
        }
      },
      "fmDataMigration": {
        "source": {
          "account": "geist",
          "pwd": "<pass>",
          "key": "<encryptionKey>",
        },
        "clone": {
          "account": "geist",
          "pwd": "<pass>",
          "key": "<encryptionKey>",
        }
      }
    },
    {
      "remote": {
        "fileName": "Data.fmp12",
        "url": "http://<otto-dev-server>:3030/api/file/download/Data",
        "auth": {
          "user": "admin",
          "pass": "<pass>"
        },
        "fms": { "clone": true }
      },
      "local": {
        "fileName": "Data.fmp12"
      },
      "fmDataMigration": {
        "source": {
          "account": "geist",
          "pwd": "<pass>"
        },
        "clone": {
          "account": "geist",
          "pwd": "<pass>"
        },
        "additionalOptions": ["-ignore_fonts", "-ignore_valuelists"]
      }
    }
  ]
}

Concurrency

  "concurrency": 5,

This sets the number of tasks to be performed concurrently. The default is 5. You can set to more or less.  But it isn't clear that setting it much higher than five has any benefit on speed.  

closeFileTimeoutSeconds

  "closeFileTimeoutSeconds": 90,

When Otto closes any open files, you can tell it what to use as a timeout.  90 seconds is the minimin and default.  Setting it to 0 or less will force the files closed immediately.

Remote

{
 "remote": {
  "fileName": "Contacts.fmp12",
   "url": "http://<otto-dev-server>:3030/api/file/download/Contacts",
    "auth": {
       "user": "admin",
       "pass": "<pass>"
     },
 "fms": { "clone": true }
}

Here we set the information for getting the file from the remote server. The "auth" section requires the Admin Console password for the remote Otto server. You must set "clone" to true if you want to do a data migration.  

You can access a previously saved copy or clone of the file by adding a "?savedFolder=myVersion2" to the end of the url. If the file doesn't already exist in that folder at that time it will be created.

...
 "url": "http://<otto-dev-server>:3030/api/file/download/Contacts?savedFolder=myVersion2",
...

The remote server doesn't need to be an Otto Server. The requested file simply needs to be available over HTTP. It can be on any web server.  Simply set the URL to be the full URL to the file, where ever it is.

In addition, the remote web server can be protected with basic auth.

Local

"local": {
   "fileName": "Contacts.fmp12",
   "folder": {
   "fmsDBFolder": "other1",
    "subfolder": "CRM"
 }
}

In the local section, we set the local fileName.  This does not need to be the same name as the file on the remote server.  This means you can change the name of a file on the way in.

The folder section is required but it can be empty , {}.

The folder section determines where the file is to be installed on the FileMaker server IF IT DOESN'T ALREADY EXIST on the local server.  If the file is already there, and we are doing a migration or replacement, then this section is ignored.  This allows you to do in an initial install on to a server to a known location.

fmsDBFolder

This property can be set to "default", "other1", and "other2", corresponding to folder locations you can set up for databases in the FileMaker server. In FileMaker 17 "other2" is now called "Secure" in the User Interface and can't have subfolder.  You still specify "other2" with FileMaker Server 17 here in this JSON Doc.  But in the UI it is called "Secure"

subfolder

This is the name of the subfolder you want to install the file into if it doesn't already exist.  In FileMaker 17, other2 can't have a subfolder

fmDataMigration

"fmDataMigration": {
  "source": {
    "account": "geist",
    "pwd": "<pass>"
  },
 "clone": {
    "account": "geist",
    "pwd": "<pass>"
},
    "additionalOptions": ["-ignore_fonts", "-ignore_valuelists", "-ignore_accounts"]
}

This section provides the information to the fmDataMigrator command line utility, so it can do its thing. account and pwd are for the FileMaker file in this case.  The source is the "source of the data" and "clone" is the clone retrieved from another server.  This lets you specify the credentials to use to do the migration.

You can also specify any of the other options to pass to the command line fmdatamigrator. using the "additionalOptions" property.  It takes and array of strings.

Still need help? Contact Us Contact Us