Mirrors
A mirror is a local copy of the objects of a Dynamics NAV database, kept up to date in the background. Prism
for C/AL exports the objects as text through the C/SIDE development environment, finsql.exe, and
you open the mirror as an object store without exporting anything yourself. You define and manage mirrors on
the Mirrors page of the Control Panel.
Opening it
- Select Mirrors in the rail of the main window.
- Select File › Mirrors… in the main window, or press Ctrl+M.
- Select Open mirror… on the Home page while no mirror is defined.

| # | Name | Description |
|---|---|---|
| 1 | Mirror list | Your mirrors, and the commands for all of them. See Mirror list. |
| 2 | Mirror commands | Test, open, re-initialize or delete the selected mirror. See Mirror settings. |
| 3 | Status | The state of the mirror's last synchronization. See Mirror status. |
| 4 | Mirror settings | The selected mirror's settings, in groups. See Mirror settings. |
Mirror list
The left side of the page lists your mirrors. The commands above the list act on all mirrors.

| # | Name | Description |
|---|---|---|
| 1 | New mirror | Adds a mirror. See Create a mirror. |
| 2 | Synchronize | Synchronizes all mirrors that have automatic synchronization on, now. See Synchronize mirrors. |
| 3 | More actions | Import… and Export…. See Export and import mirrors. |
| 4 | Unsaved changes | Save saves all mirrors; Discard drops every unsaved change. |
| 5 | Mirror | The mirror name, its server and database, and Sync on or Sync off. A bar under the row runs while that mirror synchronizes. |
Changes to mirrors are not saved until you select Save in the banner that reads You have unsaved changes. Save saves all mirrors at once; Discard drops every unsaved change.
When you open a mirror from the page, select Synchronize or Export…, or restart Prism to apply a theme change while there are unsaved changes, Prism asks Save your changes?: "There are unsaved changes to one or more mirrors."
| Button | Effect |
|---|---|
| Save | Saves all mirrors, then carries on. |
| Don't save | Carries on without saving. Your changes stay on the page, unsaved. |
| Cancel | Stops, and leaves your changes unsaved on the page. |
Mirror settings
The right side of the page shows the selected mirror: its commands, its status and its settings.

| # | Name | Description |
|---|---|---|
| 1 | Test connection | Tests that Prism can reach the database and the service tier. Prism says Mirror is OK! or lists the problems. Enabled once the NAV adapter, server, database name and finsql.exe path are filled in, and a user name when you give a password. |
| 2 | Open mirror | Opens the mirror as an object store. Enabled once the mirror has synchronized at least once. |
| 3 | Re-initialize | Exports all objects again. See Re-initialize a mirror. |
| 4 | Delete | Marks the mirror for deletion. It is deleted when you select Save; Discard keeps it. |
| 5 | Status | The state of the mirror's last synchronization. See Mirror status. |
| 6 | Setting groups | Identity, Development environment, Database, Service tier, Filters and Synchronization. They start expanded; the settings are listed below. |
Each mirror has these settings, in the groups the page shows. They apply from the mirror's next synchronization.
| Setting | Options | Default | Effect |
|---|---|---|---|
| Identity | |||
| Mirror name | Any text | Empty; the list then shows Server.Database |
The name shown in lists and menus. |
| Mirror Id | Read-only | Set when you first save the mirror | The mirror's unique identifier, with a button that copies it. Use it in a post-update hook to act on one mirror only. |
| NAV adapter | NAV 2013, NAV 2015 and later | Set from the version of the finsql.exe you pick | The version family of the database, which decides how Prism talks to it. |
| Development environment | |||
| finsql.exe | A full path; … opens Select finsql.exe | Empty | The C/SIDE development environment that exports the objects. Use the one that belongs to the database. A version no adapter supports shows This version of NAV (…) is not supported by any NAV adapters. A file that does not exist shows The file does not exist. |
| Database | |||
| Server | A SQL Server name | Empty | The SQL Server that hosts the NAV database. |
| Database name | A database name | Empty | The NAV database on the server. |
| User name | A SQL Server login | Empty: Windows authentication | The login Prism and the development environment connect with. |
| Password | The login's password | Empty: Windows authentication | The field shows the password as plain text. Prism stores it encrypted and never exports it. |
| Trust server certificate | On, Off | Off | Skips validation of the SQL Server certificate chain. Turn it on when the server uses a self-signed certificate. |
| Service tier (shown when the NAV adapter supports service tiers) | |||
| Server name | A host name; … looks it up | Empty | The host of the NAV service tier. See Choose a service tier. |
| Instance name | A service instance name | Empty | The service tier instance. |
| Management port | A port number | 7045 |
The service tier's management port. |
| Filters | |||
| Object ID include filter | ID ranges separated by |, such as ..41999999|43000000..43999999|45000000.. |
Empty: every object | Mirrors only the objects whose IDs match. Use it to keep to the objects your NAV license lets you export as text. |
| Version list exclude filter | Values with * wildcards, separated by |, such as *SOMEADDON*|RESERVED |
Empty: no object is left out | Leaves out the objects whose version list matches. |
| Synchronization | |||
| Object encoding | A blank entry, or a code page from the list | Blank: the Default object encoding setting | The text encoding of the mirrored object files. |
| Automatic synchronization | On, Off | On | When on, Prism synchronizes the mirror on the Synchronization interval and when you select Synchronize. |
Prism-wide mirror settings, such as the interval and the connection timeout, are in the Mirrors settings.
Mirror status

| # | Name | Description |
|---|---|---|
| 1 | Status | Says when the synchronization failed, and why. |
| 2 | View details | Shows the error message, its details and the stack trace. |
| 3 | Copy to clipboard | Copies the same text. |
| 4 | Troubleshoot | Opens Troubleshooting in your browser, at A mirror cannot contact a service tier. |
| Status | Meaning |
|---|---|
| Synchronization in progress | Prism is synchronizing the mirror now. |
| Not synchronized, yet. Press 'sync now' button, or wait until next scheduled synchronization | The mirror has never synchronized, so it cannot be opened yet. |
| Ok — last synchronized … | The last synchronization succeeded, at the date and time shown. |
| Error when last synchronized (…) | The last synchronization failed. The mirror keeps the objects of its last successful synchronization. |
After an error, three links help you find the cause:
- View details shows the error message, its details and the stack trace.
- Copy to clipboard copies the same text, for instance to send to us.
- Troubleshoot opens Troubleshooting in your browser.
Create a mirror
Create a mirror to browse the objects of a NAV database. You need the C/SIDE development environment that belongs to the database, and NAV 2013 or later.
- Select New mirror. A row named <New Mirror> is added and selected.
- Type a Mirror name.
- Select … next to finsql.exe and pick the development environment. Prism sets the NAV adapter from the file's version.
- Type the Server and Database name. Leave User name and Password empty to use Windows authentication.
- If the development environment needs a particular service tier, choose a service tier.
- Select Test connection. Prism says Mirror is OK! when it can reach the database and the service tier.
- Select Save in the banner.

| # | Name | Description |
|---|---|---|
| 1 | Save | Saves the new mirror (step 7). |
| 2 | Test connection | Checks the database and service tier (step 6). |
| 3 | Mirror name | The name you typed (step 2). |
| 4 | finsql.exe | The development environment, with … to pick it (step 3). |
| 5 | Server and Database name | The database to mirror (step 4). |
The mirror synchronizes at the next scheduled synchronization, or when you select Synchronize. The first synchronization exports every object, which takes a few minutes. Later synchronizations export only new and changed objects and remove deleted ones.
Open a mirror
Open a mirror to browse its objects in a Workspace window. The mirror must have synchronized at least once.
- Select Open mirror… on the Home page. The Open Database Mirror dialog opens.
- Select the mirror, then select OK, or double-click the mirror.

| # | Name | Description |
|---|---|---|
| 1 | Status | Green when the last synchronization succeeded, red when it failed, grey when the mirror has not synchronized yet. Hover it for the reason. |
| 2 | Mirror list | Your mirrors, with the columns Mirror Name, Server Name, Database Name, NAV Adapter and Sync. |
| 3 | OK | Opens the selected mirror. |
| 4 | Cancel | Closes the dialog. |
The mirror then opens as described in Opening an object store.
You can also select a mirror under File › Open › Mirror in the main window, select Open mirror on the Mirrors page, or reopen it from the recent list on the Home page. A mirror that has not synchronized yet does not open; Prism says Mirror has not been synchronized, yet.
While a synchronization commits its changes, the mirror does not open: Prism says The mirror is committing changes; please try again in a few secs. or Sorry, the mirror just started committing changes; please try again in a few secs. Wait a few seconds and open it again. See A mirror does not open while it commits changes.
Synchronize mirrors
Prism synchronizes every mirror that has Automatic synchronization on: first two minutes after it starts, then on the Synchronization interval, 15 minutes by default. To synchronize now:
- Select Synchronize on the Mirrors page. If you have unsaved changes, Prism asks you to save them first.
- Wait while the Synchronizing chip shows beside the page title. The Home page shows the progress too.
Synchronize is unavailable while a synchronization runs. When a synchronization fails, the mirror's status says why.
Re-initialize a mirror
Re-initialize a mirror when fields have been renamed in NAV or many objects have changed, or to start a failing mirror over. The mirror must be saved and have synchronized once.
- Select the mirror on the Mirrors page.
- Select Re-initialize. Prism asks Re-initialize mirror?
- Select Yes. Prism drops the mirror's copy of the objects. The next synchronization exports them all again; select Synchronize to start it now.
The full export takes a few minutes, and you cannot open the mirror until it has finished.
Choose a service tier
Choose a service tier when the development environment must reach a particular NAV service tier to export objects. Service tier selection needs NAV 2013 R2 CU10 or later, and the mirror's finsql.exe, Server and Database name filled in.
- Select … next to Server name in the Service tier group. The Select Service Tier window lists the service tiers registered in the mirror's database.
- Select a service tier. The columns are Server Name, Service Instance, Management Port, Last Active and Status.
- Select OK, or double-click the row. Prism fills in Server name, Instance name and Management port.
- Select Save in the banner.
| # | Name | Description |
|---|---|---|
| 1 | Service tiers | The service tiers registered in the mirror's database (step 2). |
| 2 | OK | Fills in the mirror's service tier settings (step 3). |
| 3 | Cancel | Closes the window and changes nothing. |
If Prism cannot read the list from the database, it says Error fetching service tier information from database. You can also type the three values yourself. Selecting OK with no row selected says No service tier selected. Please select service tier or press Cancel.
Export and import mirrors
Export your mirror definitions to share them with a colleague or move them to another computer.
To export:
- Select More actions › Export…. If you have unsaved changes, Prism asks you to save them first.
- Choose a file name. Prism saves every mirror to a
.mirrorsfile, without passwords.
To import:
- Select More actions › Import… and choose a
.mirrorsfile. The Import database mirrors window lists the mirrors in the file, with the counts Candidates and Will import. - Check each mirror's NAV adapter and change it if needed. A mirror that already exists shows the reason in the Conflict column and is not imported.
- Select Import (N). The mirrors are added to the list.
- Type the passwords of mirrors that use SQL Server authentication, then select Save in the banner.
| # | Name | Description |
|---|---|---|
| 1 | Candidates and Will import | How many mirrors the file holds, and how many will be imported. |
| 2 | Mirrors | The mirrors in the file, with Mirror name, Server and Database. |
| 3 | NAV adapter | The adapter the mirror will use; change it if needed (step 2). |
| 4 | Conflict | Why a mirror cannot be imported, such as a mirror that already exists. |
| 5 | Import (N) | Adds the mirrors to the list (step 3). |
| 6 | Cancel | Closes the window and imports nothing. |
Run a script after an update
Run a script of yours each time a mirror update writes object files, for instance to copy them to a version control folder or an AI workspace. One script serves all mirrors.
- Select Copy sample script in Settings › Mirrors › Post-update hook, paste it into a
.ps1file and adapt it. - Select Browse... next to Post-update hook and pick the script.
- In Input, choose what the script receives on standard input.

| # | Name | Description |
|---|---|---|
| 1 | Post-update hook | The path of your script (step 2). |
| 2 | Browse... | Picks the script. |
| 3 | Input | What the script receives on standard input (step 3). |
| 4 | Copy sample script | Copies a sample script to adapt (step 1). |
Prism runs the script after a synchronization, or the opening of a mirror, that added, changed or deleted object
files. To act on one mirror only, compare PRISM_MIRROR_GUID with its
Mirror Id. Clear the path to stop
running the script.
| Script | Runs under |
|---|---|
.ps1 | PowerShell 7 if it is installed, otherwise Windows PowerShell 5.1 |
.bat, .cmd | cmd |
.sh | sh |
The script receives these environment variables:
| Variable | Value |
|---|---|
PRISM_MIRROR_DIR | The mirror's root folder. |
PRISM_MIRROR_OBJECTS_DIR | The folder that holds the .txt object files. |
PRISM_MIRROR_NAME | The mirror name. |
PRISM_MIRROR_GUID | The Mirror Id. |
PRISM_MIRROR_DB_SERVER | The database server. |
PRISM_MIRROR_DB_NAME | The database name. |
PRISM_UPDATE_KIND | Full or Incremental. |
PRISM_ADDED_COUNT | The number of object files added; on a full update, every object. |
PRISM_CHANGED_COUNT | The number of object files changed. |
PRISM_DELETED_COUNT | The number of object files deleted. |
The Input setting chooses what Prism writes to the script's standard input:
| Input | Standard input |
|---|---|
None | Nothing; the script uses the environment variables only. |
PlainText | The update kind on the first line, then one line per file, prefixed + for added, ~ for changed and - for deleted. |
Json | One JSON object with the time, the mirror's name, Mirror Id, folder, server and database, the update kind, and the lists of added, changed and deleted files. |
Prism stops a script that is still running after 30 seconds. A script that exits with a code other than 0, or that times out, is recorded in the log; Prism shows no message.