Custom Snapshots Configuration

Hi Everyone,

As you know Acumatica supports Snapshot functionality to copy, migrate, backup and restore data between one or multiple instance of Acumatica. Using snapshots you even can migrate data between different database types (Cloud, Microsoft Sql Serve, MySql).
You can get more about snapshots from this video – Acumatica Snapshot on YouTube

When you creating snapshot, system will go through all database tables, select appropriate data and put it into separate tenant (with negative tenant id, which is actually linked to original tenant by id number).
You can define what data will selected from the database, by defining Export mode:

Acumatica Snapshots Configurations
Snapshots is database level technology that knows nothing about business logic and other stuff. System will just go through all specified tables and copy all data with no restrictions and no validation.

But you can define your own configuration for snapshots engine.

All snapshots configurations are stored on the file-system withing Acumatica site instance – “C:Program Files (x86)Acumatica ERP<Your Site Name>App_DataSnapshotConfigs”

Acumatica Snapshot Configurations Folder

If you open the simplest file – “Full except Attachments.esc”, you will see this XML code:

<Tables fill ="True">
  <Exclude  table="UploadFile" />
  <Exclude  table="UploadFileInScreen" />
  <Exclude  table="UploadFileRevision" />
  <Exclude  table="SearchIndex" />

Some points here:

  • Tag “Tables” – is tag where you should specify all table that system needs to process.
    • To include or exclude tables from this list you can use appropriate child tags (< Include/>, <Exclude/>) with specifying required table name.
    • By default list of tables is empty and you need to include it one by one. But you can specify fill =”True” attribute and system will preload this list from the database, in this case you need to exclude unwanted tables.
    • Acumatica uses “exclude” way in all configs to support your custom tables in snapshots by default.
  • “Exclude/Include” tags are used to specify tables that should be processed by Snapshots engine.
    • You always have to specify the name of table like it is named in the database.
    • System will process this list of tables one by one and if you specify exclude for some table, but after some line will include it back, than in the result this table will be processed.
    • Some times, if you need apply restriction conditions on selected data, you can use “condition attribute”. <Include  table=”FixedAsset” condition =”where RecordType = ‘C'” /> – in this example, before selecting data system will add additional “where” restriction to generated SQL. Here you can use “where” and “join” conditions that are written based on T-SQL language, but the platform will automatically convert it to MySql as well.
  • “ResetColumn” tags are used to modify data during export of the snapshot. You should specify a column name and the new value. During export operation system will automatically handle these rules and apply all changes. Values can:
    • Be a constants – value=”NULL
    • Refer to other field – value=“[StartNbr]”
    • Can contains conditions – value=”[StartNbr]@NumberingID!=TMCONTRACT
    • Can contains some formula – value=”TrimToOrig(00000000000000000000000000)” – in this case system will adjust new number to length of original one.

If I create new file and just put in the same folder, I will be able to use it in Acumatica.

Here file “Access Rights.esc” contains only information about access right tables that you can export from Acumatica and use for easier implementation next time.

  <Include  table="Users"/>
  <Include  table="Roles" />
  <Include  table="UsersInRoles" />
  <Include  table="RolesInGraph" />
  <Include  table="RolesInCache" />
  <Include  table="RolesInMember" />

Acumatica Custom Snapshots Configurations

Have a nice configurations!

7 Replies to “Custom Snapshots Configuration”

  1. Hi Sergey,

    Does this method works only if export format is XML ? Or it works both ways for both export formats? Thanks.

  2. Vannak,
    That happens when original schema of Contract table (where snapshot was create) is different from schema of destination table.
    Just for example it might be column length or new custom columns.
    Try to apply customization before import snapshot or try to compare tables schema.

  3. Hey I just wanted to say how extremely helpful this blog is. I've often come across solutions here to problems which I haven't been able to figure out using the Acumatica documentation.

    In fact, even our solution provider has turned down various requests which they thought were not possible with our cloud based Acumatica instance. Once such request was customization of the login screen, to which a solution was provided by this blog.

    Thanks so much for your work and wishing you a Happy and prosperous 2018.

    Kind regards,

Leave a Reply

Your email address will not be published. Required fields are marked *