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" />
</Tables>

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.

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

Acumatica Custom Snapshots Configurations

Have a nice configurations!

13 Replies to “Custom Snapshots Configuration”

  1. Hi,

    How can I apply multiple conditions in ResetColumn Attribute?
    for e.g.

    I tried but not able to reproduce exact result .
    Please help me
    Thanks in advance
    Regards

    1. Try to add “@” before each conditions.

      Conditions are merged as OR.
      But honestly I haven’t really tried this in life 🙂

      1. Thanks for your prompt reply. But conditions are not working as expected.
        My requirement is that numbering sequence should not be reset for some specific Numbering IDs

        Below is code block which I have tried.

        thanks again

      2. Thanks for your prompt reply. But conditions are not working as expected.
        My requirement is that numbering sequence should not be reset for some specific Numbering IDs

        Below is code block which I have tried.



        thanks again

      3. Thanks for your prompt reply. But conditions are not working as expected.
        My requirement is that numbering sequence should not be reset for some specific Numbering IDs

        Below is code block which I have tried.

        for “NumberingSequence” Table
        ResetColumn name=”LastNbr” value=”StartNbr]@NumberingID!=FORMULA@NumberingID!=QCPLAN@NumberingID!=QCSP”

        I don’t know why it is not allowing Code Block so replying again in plain text.
        thanks again

        1. Hi Subodh,
          Unfortunately, your formula “StartNbr]@NumberingID!=FORMULA@NumberingID!=QCPLAN@NumberingID!=QCSP” won’t really work.
          As I said, the formula is OR, not AND.
          So you have to reverse it and make “StartNbr]@NumberingID=A@NumberingID=B@NumberingID=C”

  2. Hi Sergey,

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

  3. 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.

  4. 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,
    Michael

Leave a Reply

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