CLI tool to transfer system data between environments

Today I wanted to share an useful tool that I built few months ago to work across environments of the same instance.

The CLI System Data is a command line tool built to simplify some of the data transferring tasks between environments of the same system.

The System Data tool helps you export and import some of the data available in Sugar using JSON data files.

It has been built for Sugar 7.9 and above, as it leverages prepared statements.

You can read more about its features and functionalities on the SugarLabs repository: https://github.com/sugarcrmlabs/SystemData

Cheers

Parents Reply Children
  • Hi Enrico Simonetti,

    I used this tool multiple times in my dev environment and recently used it for production deployment as well. Worked very well. Couple of issues so far related to Users and Reports import.

    1. While importing Users, it threw warning that SNIPuser already exists. I believe it should update the user if already exists. Please correct me if I understood it wrongly.

    2. While importing Reports, it threw error that report could not be saved due to missing teams. But I had already imported teams, users and their memberships in proper order.

    Please let me know if you have some idea on this, meanwhile I will also dig into it.

    Thank you once again as it saves a lot of time and even an admin can do this without getting into much detail.

    Regards.

    Hats

  • Hi hats,

    That's great!

    Are you actually using the tool to export data from a system and then into another system without manual intervention? Or are you manipulating the JSON files and/or the database?

    Quick pointers to help you investigate:

    1. Does the SNIPuser's id on the database match the id on the json file? Maybe you have duplicate usernames with different ids? Records are only updated by their id with this tool. What is the message you see?
    2. Maybe an exported Report includes a Team that is not present on your team export? Have a look

    Cheers

    --

    Enrico Simonetti

    Sugar veteran (from 2007)

    www.naonis.tech


    Feel free to reach out for consulting regarding:

    • API Integration and Automation Services
    • Sugar Architecture
    • Sugar Performance Optimisation
    • Sugar Consulting, Best Practices and Technical Training
    • AWS and Sugar Technical Help
    • CTO-as-a-service
    • Solutions-as-a-service
    • and more!

    All active SugarCRM certifications

    Actively working remotely with customers based in APAC and in the United States

  • Thanks for the quick response Enrico Simonetti.

    Yes, I am using this tool to import data from UAT system to Production system without any manual intervention with standard users, teams and roles already present on the production system.

    1. Regarding duplicate user error, you are right. Production system already had this user entry with different ID and hence got an error.

    2. I exported these reports from UAT and imported into production with all the required teams, users and roles imported earlier with success. I will have another look into this.

    Just thought of sharing it here. Thank you.

    Regards.

    Hats