Migrating from v1

This document is used to transfer projects of existing v1 project to new v2 project. These processes are not required in new projects.

Pre requirements

  1. Email Integration on MomentumSuite

  2. GitHub Integration on MomentumSuite

  3. Visual Studio Code installation

  4. NodeJS installation

Create new v2 Project

  1. Create a new Client on v2 system.

  2. Create a new iOS or Android project on v2 which will be imported.

  3. Create a new section with name “Migrated Cases“ and press ENTER

  4. Create a new case with name “Dummy Case“, Type: “Automation“, Coding Language:”Javascript”, Framework: “Mocha“ under the Migrated Cases section

  5. Create a new Step with name “Dummy Step“ inside the Dummy Case.

Migration Steps

  • Checkout the existing code from v2 with Git Clone (Checkout Branch: Javascript)

  • Add the following dependencies on your package.json file (for migrate.js)

"dependencies": { "mysql": "^2.18.1", "slugify": "^1.4.5" },
  • Run the following command on the root folder of your project to install dependencies.

npm update

  • Move the following file “migrate.js“ into the root folder of your project.

  • Set your MySQL connection string on migrate.js file.

var connection = mysql.createConnection({ host : 'YOUR_HOST_NAME_IP', user : 'YOUR_DB_USER', password : 'YOUR_DB_PASS', database : 'YOUR_DATABASE_NAME' });
  • Learn your project ID from mySQL database and set it on migrate.js (APPLICATION_ID = 584; )

SELECT * FROM momentum2.Application where title LIKE '%PROJECT NAME%';

SELECT ID FROM momentum2.Application where title LIKE '%PROJECT NAME%';

  • Set your Section Id from v2 Dummy Case’s Section “Migrated Cases“. Expand migrated-cases folder and open dummy-case.js file on your v2 project. Learn your Section ID and replace YOUR_V2_ID with your ID on migrate.js file.

[Momentum.Section(Id=YOUR_V2_ID, Title='Migrated Cases')]

[Momentum.Section(Id=2697, Title='Migrated Cases')]

  • Create 2 folders on your project’s root… Folder1: Libraries Folder2: scripts

  • Run migrate.js file.

node migrate.js

  • Commit & Push your code to Git.

  • After a while, Do not forget to pull your code to get the MomentumSuite system assigned CaseId and StepId.

  • Check MomentumSuite website to verify.

 

Files

After the migration, You have to Convert scripts to ES5 fomat