Deploy the Package Code using SFDX

Hello Everyone, In the last post we have discussed  how we can quickly setup the SFDX. We also use the basic command to move code using SFDX, create scratch org and use them for development.

Today we will cover If we are an ISV partner so how we can best use the SFDX and how we can move our package code into scratch org to continue with development and effectively use the SFDX.

First we need to authenticate our dev hub org.  Then we will create a new project to store our project metadata.

[code]

sfdx force:project:create -n MyPkgProject

cd MyPkgProject

[/code]

Now we need to authentic our package org to take a backup of code.

[code]

sfdx force:auth:web:login -a MyPkg

[/code]

Now make a directory to store the metadata and fetch the data from source.

[code]

sfdx force:mdapi:retrieve -s -r ./dummy -u MyPkg -p TestData

[/code]

SFDXV2 1.png

This will gives us a zip file. Which we need to unzip. Next we will convert this metadata into SFDX format.

[code]

sfdx force:mdapi:convert -r ./dummy

[/code]

Next we will create a new scratch org to move our metadata there.

[code]

sfdx force:org:create -s -f config/project-scratch-def.json -a pkgscratchorg

[/code]

And when our scratch org is created we are ready to push our code into new scratch org.

SFDXV2 2.png

[code]

sfdx force:source:push

[/code]

And when we get the success message we can open the org and can continue with our development.

[code]

sfdx force:org:open

[/code]

So within few steps we can easily move our packaging code to SFDX format and can use all the benefit of SFDX.

Did you have anything to add, Let me know in the comments section. Happy programming 🙂

 

Advertisements

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.