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.

sfdx force:project:create -n MyPkgProject

cd MyPkgProject

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

sfdx force:auth:web:login -a MyPkg

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

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

SFDXV2 1.png

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

sfdx force:mdapi:convert -r ./dummy

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

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

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

SFDXV2 2.png

sfdx force:source:push

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

sfdx force:org:open

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 🙂



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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