Blog

Software tips, techniques, and news.

FMDeveloperTool in Claris FileMaker

Do you host your FileMaker files on a Linux server? Have you ever needed to encrypt your FileMaker applications or change the permissions of your users? As you are probably aware, FileMaker Pro is not accessible on a Linux server, and consequently, neither are the very useful “developer utilities” that are featured in FMP. Until recently, if you wanted to modify your FileMaker applications, you would have had to copy your system over to a Mac or Windows machine and then bring it back to your Linux server. This is obviously an annoying process!

With the release of Claris FileMaker 20.3, we got a new set of command-line tools called the FMDeveloperTool, which allows us to access a number of features previously unavailable on Linux systems. As of Claris FileMaker 21.1.1, we have even more functionality, opening up new possibilities by letting developers see the file size of individual tables, fields, and indexes.

youtube-preview

FMDeveloperTool Features

  • Enabling and removing file encryption

    • Encrypt your database files to protect them from unauthorized access while they are being stored on disk

  • Removing admin access

    • Remove administrative access from all accounts and prevent users from modifying most design or structural elements of your databases

  • Saving a copy (compressed, self-contained) or making a clone

    • Rename a set of database files and automatically update the internal links to related files and scripts

  • Enabling Kiosk mode

    • Display your database files in Kiosk mode

  • Saving a copy as XML

  • Recovering a damaged file

  • Consistency checking a file

  • Rename Files

    • Creates copied files with updated names, including updates to the external data sources included in the file set.

  • Query for table, field or index sizes

    • Query a database for the size of a table, field or index in the specified measurement unit.

  • Find which tables, or fields within a given table, have the largest file size

  • Upload database files to a host

The rest of this guide assumes you have a basic understanding of using the Terminal on Mac or Command Line on Windows / Linux.

The FMDeveloperTool is included in FileMaker Server versions 20.3 and above. See the default locations here:

claris filemaker developer tool directory.

You can also download this tool directly from Claris, and use locally in any filepath. After downloading the tool, open your terminal and go to the file directory where the tool is located, then run ./FMDeveloperTool. If successful, you should see the following message.

filemaker developer tool terminal.

Saving a copy (compressed, self-contained) or making a clone

Suppose you want to make a copy of your FileMaker application with a different name for development purposes. This is a very common practice when adding new features or testing a migration on your application. If your file was hosted on a Linux server, this would be an annoying process, but using the FMDeveloperTool, we can easily perform this action from the command line by running:

--copy <source_filename> <username> <password> [-target_filename | -t <path>] [-encryption_key | -e <key>]

--clone <source_filename> <username> <password> [-target_filename | -t <path>] [-encryption_key | -e <key>]

Then, in the admin console, simply open the new file and begin hosting.

Enabling and removing file encryption

Enabling and removing file encryption can be really useful, especially if the data in your FileMaker application is related to medical records or requires security clearance. FMDeveloperTool allows you to do this very easily from the command line. Simply run the following command, putting in the proper filename, username, and password.

--enableEncryption <source_filename> <username> <password> [-target_filename | -t <path>] [-encryption_key | -e <key>] [-sharedID | -s <ID>] [-passcode | -p <passcode>] [-passcode_hint | -h <hint>] [-keep_open_storage | -o]

To revert this process, simply run the inverse command.

--removeEncryption <source_filename> <username> <password> [-target_filename -t <path>] [-encryption_key -e <key>]

Removing admin access

In FileMaker, there is a default user called “Admin,” which has full access. If this account was compromised, or if you wanted to prevent any malicious changes to your application after launch, you might want to permanently delete this user, which you can do by running the following command:

--removeAdminAccess <source_filename> [-target_filename -t <path>] [-encryption_key -e <key>]

An important thing to be aware of is that if the Admin was the only account with Full Access, certain aspects of your application will be permanently inaccessible, so make sure that you have an available Full Access account before running this command.

Saving a copy as XML

If you’re performing some advanced data-driven development on your application, it might be useful to save a copy as XML. This allows you to drill into certain data points, or, on a more basic level, can be used with a version control system, such as Git, to compare file version history. To do this from the command line, run the following:

--saveAsXML <source_filename> <username> <password> [-target_filename | -t <path>] [-encryption_key | -e <key>]

Consistency checking a file

If a FileMaker file is closed improperly, a consistency check will be performed to determine if the file has been damaged. If you want to manually run this command, possibly on a schedule, you could use the following command:

--checkConsistency  <source_filename> [-encryption_key -e <key>]

Recovering a damaged file

In the unfortunate case that you have damaged your FileMaker file, Claris recommends first saving a “compacted copy." If that doesn’t work, you can try the recover command. This should recreate your file and salvage as much data as it can while also providing you a status report of unrecovered data so you can find out exactly what information was lost in the damage. To create a recovery file, simply run:

--recover <source_filename> [-target_filename -t <path>] [-encryption_key -e <key>] [-generate | -g <rebuild | datablocks | asis>] [-skipSchema | -r] [-skipStructure | -l] [-rebuildIndex | -i <now | later | false>] [-keepCaches | -k] [-bypass | -b] [-username | -u <username>] [-password | -p <password>]

A note about recovered files: they are often larger than the original file. Claris suggests using a backup of your original file and copying the data from your recovered file into this.

Enabling Kiosk mode

Kiosk mode is a way to limit users who might be unfamiliar with FileMaker by removing access to the default window functions. These can be distracting, confusing, or could possibly even cause data loss if used incorrectly. Using the FMDeveloperTool, we can easily lock down access by running the following command:

--enableKiosk <source_filename> [-target_filename -t <path>] [-encryption_key -e <key>]

Conveniently, Kiosk mode does not affect Full Access users, so this can be a useful way to limit some users while allowing your power users to continue using all FileMaker functionality. However, Kiosk mode will completely lock down the machine running the application and will prevent accessing other programs. As the name suggests, this is most useful for an application that will be publicly facing, such as at a kiosk.

Rename Files

If you need to update the names of your files and their external data sources (for example, to change “FileName_Dev” to “FileName_Staging”), you can use the following command. The file names or paths you supply must be exact. You will need to provide the path to the databases folder, the admin console credentials, the encryption key if the file has one, and what should be replaced.

--renameFiles <target_folder> <username> <password> [-encryption_key -e <key>] [-source_filelist -sl <filenames_or_paths>] [-regex -rg <regular_expression_text_to_replace>] [-replace_text -rt <replace_with_text>]

Note that this command creates a NEW file; it does not simply rename the existing file, so be sure that you have enough space to copy the file(s) and that you handle deleting or moving the original file(s).

Query for table, field, or index sizes

Getting the size of tables is an extremely powerful tool to have. Large databases can have performance issues and determining where the bulk of your data is can help you identify and resolve the issues. Using this command can help you identify if a particular is the cause of your bloat or if a log field has grown too large and is impacting your performance.

--querySize <source_filename> <username> <password> [-encryption_key -e <key>] [-target_tablename -tt <table_name>] [-target_fieldname -tf <table_name>] [-query_index -qi] [-exclude_container -ec] [-size_unit -su]

This example below returns the total size of all record data in the Product Details table of the source file, SampleDB.fmp12.

FMDeveloperTool --querySize SampleDB.fmp12 admin admin -encryption_key abc -target_tablename "Product Details" -size_unit mb

Table size of Product Details is 4852 mb.

The second example returns the total size of all record data in the target field, Photo, in the Product Details table of the source file, SampleDB.fmp12.

FMDeveloperTool --querySize SampleDB.fmp12 admin admin -encryption_key abc -target_tablename "Product Details" -target_fieldname Photo -size_unit mb

Field size of Product Details:Photo is 2627 mb.

The third example returns the total size of the value and word indexes of the target field, Name, in the Product Details table of the source file, SampleDB.fmp12.

FMDeveloperTool --querySize SampleDB.fmp12 admin admin -encryption_key abc -target_tablename "Product Details" -target_fieldname Name -query_index

Field name: Product Details:Name    Value index Size: 1449(bytes)    Word index Size: 1593(bytes)

Find the largest tables or fields

Use this command to determine the largest tables within your file or the largest fields within a table. You can ignore container data, which would generally be faster, and let you focus on the data entry and calculation fields that may be larger than you realized. You can also limit your query to indexes, which can help you determine if there are fields that should be unindexed. This command features another option to return results as comma-separated values.

--sortBySize <source_filename> <username> <password> [-encryption_key -e <key>] [-target_tablename -tt <table_name>] [-target_fieldname -tf <table_name>] [-query_index -qi] [-exclude_container -ec] [-size_unit -su] [-csv_format -cf]

This example returns the top five fields that contain the most record data in the target table, Product Details, of the source file, SampleDB.fmp12. This is useful for detecting fields that contain a large amount of data that could potentially be causing performance problems when referencing records on the table.

FMDeveloperTool --sortBySize SampleDB.fmp12 admin admin -encryption_key abc -target_tablename "Product Details" -quantity 5

FieldName       FieldSize    Units

"Photo" 2690893 bytes

"Notes" 42094   bytes

"Name"  390     bytes

"Price" 160     bytes

"Stock" 80      bytes

Upload database files to a host

Use this in lieu of the FileMaker Pro “Upload to Host…” command through the File > Sharing menu to save yourself time, especially when working with multiple files. 

--uploadDatabases <host_name> <host_username> <host_password> [-encryption_key -e <key>] [-database_pathlist -dl <pathlist>] [-target_folder -tf <target_folder>] [-without_remote_container -worc] [-ignore_certificate -ic] [-automatically_open_db_off -aodo]

This example uploads an encrypted database file to the secure database folder on the FileMaker Server host at myhost.example.com, after which the database is automatically opened on the host. To do this, you have to have the host's admin credentials, the encryption key if the file is encrypted, and the path to the database folder.

FMDeveloperTool --uploadDatabases myhost.example.com admin admin -database_pathlist SampleDB.fmp12 -encryption_key abc -target_folder Secure/

"SampleDB.fmp12": File was uploaded successfully.

Summary: All database files were uploaded successfully.

The second example uploads all the database files in the MyApps folder in the current directory and the SampleDB4.fmp12 database in the Documents folder, which are all encrypted with the same password, but doesn't upload the externally stored container data and doesn't automatically open the databases on the host after upload.

FMDeveloperTool --uploadDatabases myhost.example.com admin admin -database_pathlist MyApps ~/Documents/SampleDB4.fmp12 -encryption_key abc -target_folder Secure/ -without_remote_container -automatically_open_db_off

"SampleDB2.fmp12": File was uploaded successfully.

"SampleDB3.fmp12": File was uploaded successfully.

"SampleDB1.fmp12": File was uploaded successfully.

"SampleDB4.fmp12": File was uploaded successfully.

Summary: All database files were uploaded successfully.

Conclusion

The FMDeveloperTool has a number of useful features for those looking to identify the source of file bloat, those hosting their FileMaker applications on a Linux server, and those generally looking to streamline their deployment process. We hope this guide has made using this tool that much easier. Download our demo file for a helpful command builder. If you have any questions about the new FMDeveloperTool, please contact DB Services.

Did you know we are an authorized reseller for Claris FileMaker Licensing?
Contact us to discuss upgrading your Claris FileMaker software.

Download the FMDeveloperTool File

Please complete the form below to download your FREE FileMaker file.

First Name *
Last Name *
Company
Email *
Phone *
FileMaker Experience *
Agree to Terms *
mary hodges headshot.
Mary Hodges

Mary is a certified FileMaker and web developer with high standards and a focus on delivering outcomes that exceed client expectations.