npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

smax_mig_tool_auto

v1.0.20

Published

Pupeteer script to automate deployment of ServiceMax migration from Source to Target org

Downloads

27

Readme

How to get started with this npm package

1. Install package

npm i smax_mig_tool_auto

2a. Create a config file with the source and target details with migration type = LIST

Example Config file

SMAX_PS_Config.json

{
    "source":{
        "Type":"sandbox",
        "Username":"Source_Username",
        "Password":"Source_Password"
    },
    "target":{
        "Type":"production",
        "Username":"Target_Username",
        "Password":"Target_Password"
    },
    "migration":{
        "Type":"LIST",
        "components":[
            ["SFM Wizards"]  
        ],
        "URL":"https://migrate.servicemax.com/MigrationTool/"
    },
    "MiscSetting":{
        "CHECKONLY":"TRUE",
        "SPM_MODAL":"FALSE",
        "OVERWRITE":"TRUE",
        "HEADLESS":"TRUE",
        "TIMEOUTS":{
            "SFLOGIN":600000,
            "VALIDATE":3600000,
            "GLOBAL":3600000           
        }
    }
}

2b. Create a config file with the source and target details with migration type = PACKAGE

Example Config file

SMAX_PS_Config.json

{
    "source":{
        "Type":"sandbox",
        "Username":"Source_Username",
        "Password":"Source_Password"
    },
    "target":{
        "Type":"production",
        "Username":"Target_Username",
        "Password":"Target_Password"
    },
    "migration":{
        "Type":"PACKAGE",
        "Location":"./manifest/package_DKSH.xml",
        "components":[
            ["SFM Wizards"]  
        ],
        "URL":"https://migrate.servicemax.com/MigrationTool/"
    },
    "MiscSetting":{
        "CHECKONLY":"FALSE",
        "SPM_MODAL":"FALSE",
        "OVERWRITE":"TRUE",
        "HEADLESS":"FALSE",
        "SPLITS":{
            "SFM":"1",
            "SFW":"1"
        },
        "TIMEOUTS":{
            "SFLOGIN":600000,
            "VALIDATE":3600000,
            "GLOBAL":3600000           
        }
    }
}

Mention the Org Type, Username and Password for Source and Target Org If one has package.xml from Watchman, set the migration type attribute as 'PACKAGE' and set the relative path of the package.xml file If one has no package.xml from Watchman, set the migration type attribute as 'LIST' and set the list of component into a 2D array Note: At the moment this feature only supports smaller volume of migration, so please do not include entire folders such as SFM Wizard, SFM Search etc

3. Create a Javascript program that includes the package and invoke the Main function as shown in the below example

Package Usage - Example

MigToolTest.js

const smax_migtool = require('smax_mig_tool_auto');
console.log(process.argv.slice(2));
smax_migtool.main(process.argv.slice(2)[0]);

4. Start the migration process using the below command

node MigToolTest.js "config/SMAX_PS_Config.json" |tee log.txt

Things to remember

  1. Make sure the Source and Target user do not have Two Factor or Multi Factor Authentication. Avoid MFA/TFA screen by introducing Login IP range on the User Profile
  2. Currently does not support ServiceMax Profile migration
  3. Use the Checkonly setting as TRUE to only validate the components between the 2 orgs and it will not be Headless process
  4. If Checkonly is TRUE, only the first index in the array of component will be processed.

Release Log

  • 1.8 Logging the validation results to a log file and Seletion of Profile from the validation screen.
  • 1.9 Fixes related to Logging SFM dependent list post validation
  • 1.10 Fixes related to expanding the validation screen
  • 1.11 Fixes the "No component selected for deployment" scenario
  • 1.12 Added Try-Catch block to progress if one of the iteration fails instead of terminating the job
  • 1.13 Displaying Validation result screen
  • 1.14 Moved Override flag logic to limit it to Override selection and Profile selection
  • 1.15 Calling out if there was any component that was not deployed
  • 1.16 Exit process.exit(1);
  • 1.17 Added Global Variable to check if any component failed
  • 1.18 Seperate Timeouts for Validation, Login and Global
  • 1.19 Added Package.xml support, now config file or package.xml can be used identify the deployable components