Deploy metadata from Scratch Org to Sandbox/Production Environment using SFDX

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ส.ค. 2024
  • Hello Trailblazers, In this video, we're going to learn how we can convert metadata from source format to metadata format so that we can deploy that to a sandbox/production environment. I am using a scratch org here that I am considering as a sandbox for deployment and as we move towards the end of the video I'll also show you how you can authorize your sandbox/producton org using sfdx so that you can use that while running the mdapi deploy command.
    Interested in learning integrations from basics ? Check out out Integration Tutorial Playlist:- • Salesforce Integration...
    Subscribe to SFDC Stop:- th-cam.com/users/sfdcstop?su...
    Interested about learning Salesforce Lightning ? We have a playlist for that too:- • Salesforce Lightning T...

ความคิดเห็น • 72

  • @sreenathreddy2482
    @sreenathreddy2482 3 ปีที่แล้ว

    Superb class, It helps for me

  • @phanikumar39
    @phanikumar39 4 ปีที่แล้ว +1

    Great classes 👍 thank you so much ❤️😊😊💕 sir

  • @hiteshkala5658
    @hiteshkala5658 2 ปีที่แล้ว

    Quiet useful, as always

  • @harivaishnav5179
    @harivaishnav5179 2 ปีที่แล้ว

    Amazing explanation. Very help full. Thank you 😊😊

    • @sfdcstop
      @sfdcstop  2 ปีที่แล้ว

      Glad it was helpful!

  • @mdshadab8332
    @mdshadab8332 4 ปีที่แล้ว

    Very helpful and informative video, thanks it really helped me.

    • @sfdcstop
      @sfdcstop  4 ปีที่แล้ว +1

      Glad to hear it, Shadab :-) Thank You!

  • @Explore_With_Yojit
    @Explore_With_Yojit 3 ปีที่แล้ว

    Very helpful video.

  • @smritisharan-sfdcamplified
    @smritisharan-sfdcamplified 4 ปีที่แล้ว

    amazing explanation. Thank you

    • @sfdcstop
      @sfdcstop  4 ปีที่แล้ว

      Glad you liked it Smriti :-)

  • @mohdhilal2059
    @mohdhilal2059 3 ปีที่แล้ว

    Thank you so much!! really helpful video.

    • @sfdcstop
      @sfdcstop  3 ปีที่แล้ว

      Glad to know that you liked it buddy, Keep Learning...!!

  • @mikeguido7068
    @mikeguido7068 4 ปีที่แล้ว

    i love this channel!!!!

    • @sfdcstop
      @sfdcstop  4 ปีที่แล้ว

      Thank you so much Mike..!! :-)

  • @nayanmore1615
    @nayanmore1615 2 ปีที่แล้ว

    Thanks!

  • @raghavendrasharma815
    @raghavendrasharma815 4 ปีที่แล้ว

    Nice video

  • @arijitnagchowdhury3740
    @arijitnagchowdhury3740 4 ปีที่แล้ว +1

    Very Good and precious

    • @arijitnagchowdhury3740
      @arijitnagchowdhury3740 4 ปีที่แล้ว

      1. We have to create scratch org after authenticating to an existing Org in Vscode. If so then will codebase/configuration not be copied into Scartch org ? After expiration of scratch Org , again we have to create and deploy from source Org. Please confirm
      2. Do we need to use VScode / CLI everytime to login into Scratch org Or can not we login directly username/password

    • @sfdcstop
      @sfdcstop  4 ปีที่แล้ว

      Hi Arijit,
      If you want to migrate a project from developer org to scratch org then yes, you need to authenticate to an existing org in vscode, take a pull by specifying a package.xml convert mdapi to source format (th-cam.com/video/WU_QPEPBwQI/w-d-xo.html) and create a scratch org and push metadata in that.
      Once the scratch org is expired you can create another scratch org and push all your metadata again in that scratch org. Your scratch org is not the source of truth, it should be your git repository.
      You don't need to login using CLI but that's easy because if you've a VSCode project that's connected to a scratch org you can directly open scratch org by using:- "Open Default Org" command. I'll share in future videos how you can get a username and password for a scratch org. Stay tuned..!!

    • @arijitnagchowdhury3740
      @arijitnagchowdhury3740 4 ปีที่แล้ว +1

      @@sfdcstop thank you

  • @sribabu8358
    @sribabu8358 3 ปีที่แล้ว +1

    Very useful video...clearly explained. one small suggestion.. you are using 'right' word most of the times..which you can limit using it. Thanks.

    • @sfdcstop
      @sfdcstop  3 ปีที่แล้ว

      It's always one or the other thing, although I am trying to notice and fix in future videos. Thanks for highlighting that.

  • @anshumandixit7791
    @anshumandixit7791 4 ปีที่แล้ว +1

    Hi!!
    Nice video, can you please also create one video for unmanaged package deployment using SFDX command with Scratch org?

    • @sfdcstop
      @sfdcstop  4 ปีที่แล้ว

      Thank you Anshuman, I've noted your suggestion. Will consider that one probably after the LWC series is complete.

  • @MolucoGamer
    @MolucoGamer 4 ปีที่แล้ว +1

    Hi!
    Based on your experience, which way do you recommend to have files tracked in a (SVN) repository? Source or Metadata format?
    Thanks.

    • @sfdcstop
      @sfdcstop  4 ปีที่แล้ว

      Hi, it depends on what approach you're following for development. If you're doing a scratch org based development, go for source format. If you're directly developing on developer/sandbox orgs, go for metadata format.

  • @ravikant2878
    @ravikant2878 4 ปีที่แล้ว +2

    Hi SFDC Stop,
    1. Is there any other way to create a sandbox without using VS Code?
    2. Also generally we can see the Sandbox Name at the top of the screen, but the sandbox which you have created here for Deployment, its name is not present. Do we need to name it explicitly?
    3. It would be great if you could just create some other video in which deployment is being done by Workbench. (A lot of people are in need for this).
    4. At last I must say this was an amazing video and thanks a lot for all your efforts :)

    • @sfdcstop
      @sfdcstop  4 ปีที่แล้ว +2

      Hi Ravi,
      You cannot actually create a sandbox even by using VSCode. I created a scratch org here for the sake of demo but the procedure/commands will be same even if you're deploying to a sandbox/production environment. This is the reason you can't see the sandbox name because you need a production environment to create a sandbox.
      Thank you for your suggestion buddy...I'll checkout deployment using workbench and will add a video asap.
      Thanks for watching, keep learning and do share it in your network too and tag me in your post (@rahulcoder - twitter/linkedin) :-)

  • @ramaanbu6478
    @ramaanbu6478 3 ปีที่แล้ว +1

    Thanks for the video....how do I add objects and fields in the package.xml.while converting source format to metada format, it's comes under the our created folder.right..but when I was converted that It won't fetch the objects and fields related to the lwc or apex class.wt I did wrong

    • @sfdcstop
      @sfdcstop  3 ปีที่แล้ว +1

      Hi Rama, I haven't tried that personally yet but I guess that's a bug with sfdx cli :- github.com/forcedotcom/cli/issues/100

  • @JunaidAnsari-ev5ir
    @JunaidAnsari-ev5ir ปีที่แล้ว

    Hi rahual ,
    thanks for the simple video,
    I was following the video and want to push all the data form QA org to UAT Org(fresh) but I got errors which I can see in deployment status ,
    Required field is missing: standardValue for multiple objects.
    can you help me ..

    • @sfdcstop
      @sfdcstop  ปีที่แล้ว

      Hi Junaid, those are specific to the metadata you're deploying. You can check with your project team members as they'll have a better background.

  • @ummegousia3823
    @ummegousia3823 3 ปีที่แล้ว +1

    How you setup source folder structure - kindly help me on it

    • @sfdcstop
      @sfdcstop  3 ปีที่แล้ว

      Hi Umme, you can create an empty sfdx project from VSCode and it'll create the source folder structure for you.

  • @praneethanp7965
    @praneethanp7965 3 ปีที่แล้ว +1

    HI, I have created community in scratch and it comes under experience bundle. I want to deploy the same to sandbox and production. How to achieve the same as it gives error.

    • @sfdcstop
      @sfdcstop  3 ปีที่แล้ว

      Hi Praneetha, I haven't tried deploying a community from scratch org, so, can't help much in that. What issue are you getting btw?

  • @abdulrehmantariq9270
    @abdulrehmantariq9270 ปีที่แล้ว +1

    is there any tool where we can build manage package in salesforce

    • @sfdcstop
      @sfdcstop  ปีที่แล้ว

      You can build it using sfdx cli itself.

  • @ankitarustagi207
    @ankitarustagi207 2 ปีที่แล้ว +1

    Hi Rahul, here all the metadata is getting deployed in production, what if we just want to deploy profiles or some part of the source project and not all metadata. Please help. Thanks.

    • @sfdcstop
      @sfdcstop  2 ปีที่แล้ว

      Hi Ankita, there are two options:
      1. You can remove the metadata you don't need from the output folder and update the package.xml in the output folder accordingly and then deploy to destination (production) org.
      2. You only fetch the data you need from sandbox and deploy that to prod. Have a look at SFDX Deploy Tool for this purpose where you just need to prepare the package.xml and you can do the deployment in one step. th-cam.com/video/EgvhT4KtXmQ/w-d-xo.html. I almost use it on a daily basis for frequent deployments.

  • @Micky-yd1gi
    @Micky-yd1gi 4 หลายเดือนก่อน

    How can we deploy a single class

  • @prema-7173
    @prema-7173 4 ปีที่แล้ว +1

    How to fetch only specific components instead of all components?

    • @sfdcstop
      @sfdcstop  4 ปีที่แล้ว

      Hey Prerna, for that you need a package.xml in the manifest. However, while working with scratch orgs, we don't need a package.xml as the salesforce cli will not fetch everything again and again at every pull. It'll only fetch the components that're updated in the org. Have a look at SFDX Deploy Tool video, that will be helpful:- th-cam.com/video/EgvhT4KtXmQ/w-d-xo.html

  • @akhilvuppala6745
    @akhilvuppala6745 3 ปีที่แล้ว +1

    If we have different scratch orgs how to switch between them

    • @sfdcstop
      @sfdcstop  3 ปีที่แล้ว

      Open the VSCode command palette. You have an option like: "Set a default org" that can be used to switch to a different org

  • @sudheer_gandham
    @sudheer_gandham 3 ปีที่แล้ว +1

    Hi Rahul,
    what if I have implemented something in scratch org and now want to deploy that into developer/sandbox -- so now what will be the process which one to use -- > source or metadata
    and also with vice-versa like from sandbox to scratch org deployment which one to use and also in which case I need to convert my code
    I hope you got my question, please reply!

    • @sfdcstop
      @sfdcstop  3 ปีที่แล้ว +1

      Hi Sudheer, if you want to move metadata from scratch org to developer org, you need to convert it from source format to mdapi format and then deploy it to developer org.
      In other case, you can convert the project back to source format and depoy it in a scratch org if you're taking a pull from developer org. Hope that helps!

    • @sudheer_gandham
      @sudheer_gandham 3 ปีที่แล้ว

      @@sfdcstop got it, thanks Rahul

  • @chikku3005
    @chikku3005 3 ปีที่แล้ว +1

    Can you explain how to deploy analytics studio in sfdx

    • @sfdcstop
      @sfdcstop  3 ปีที่แล้ว +1

      Hi Chikku, I haven't worked on the same yet.

  • @abhinavanand6188
    @abhinavanand6188 2 ปีที่แล้ว +1

    This was very helpful. Thank you.
    Is creating scratch orgs mandatory ? Can I not deploy from one sandbox to another sandbox without creating a scratch org ?

    • @sfdcstop
      @sfdcstop  2 ปีที่แล้ว

      Hi Abhinav, Scratch orgs are not mandatory, you can easily deploy from one sandbox to another using sfdx cli without creating a scratch org.

    • @abhinavanand6188
      @abhinavanand6188 2 ปีที่แล้ว

      @@sfdcstopThanks.
      1. Also, when I create a project for a sandbox, it already has package.xml. Do I need to always convert from source to metadata format ,create a new folder and then deploy that to new sandbox ?
      2. If I want to add more metadata to package.xml, do I need to create a new xml file or just update the existing one ?

    • @sfdcstop
      @sfdcstop  2 ปีที่แล้ว

      1. Sfdx is more advanced now so whatever format you have, if you have a package.xml you should be able to deploy it in a sandbox.
      2. You can update the existing package.xml itself

    • @abhinavanand6188
      @abhinavanand6188 2 ปีที่แล้ว

      @@sfdcstop Thanks.

  • @biswaray1225
    @biswaray1225 4 ปีที่แล้ว

    Hi Rahul,
    thanks for awesome video. learnt a lot.
    Is process same to deploy from scratch org to Dev hub (Developer org enabled as Dev Hub)? convert source/scratch format to metadata format using sfdx force:source:convert command.. and then deploy using sfdx force:mdapi:deploy pls confirm..

    • @sfdcstop
      @sfdcstop  4 ปีที่แล้ว

      Hi Biswa,
      Happy to know that it helped :-)
      Yes, the process will be the same for any non-scratch org, you're absolutely right.

    • @biswaray1225
      @biswaray1225 4 ปีที่แล้ว

      @@sfdcstop Thank you!!

    • @gayathriradhakrishnan200
      @gayathriradhakrishnan200 3 ปีที่แล้ว

      @@sfdcstop Hi Rahul,
      Thank you for the fantastic videos in your channel. They are helping me so much.. I really like the way you explain the concepts. Please keep up the great work :-)

    • @sfdcstop
      @sfdcstop  3 ปีที่แล้ว

      Thank you Gayathri :) More videos are on the way..!! Keep Learning 👍

  • @akhilvuppala6745
    @akhilvuppala6745 3 ปีที่แล้ว +1

    you have created a scratch org instead of Using production env or sand box. Is the command same to deploy for sandbox?

  • @architjain3157
    @architjain3157 3 ปีที่แล้ว +1

    Hi Rahul, we can also deploy in source format as well right? How is it different from deploying in Metadata format?
    Deploying in source is much easier!

    • @architjain3157
      @architjain3157 3 ปีที่แล้ว

      Also if I work on multiple non-scratch orgs is it bad to deploy from one org to another in source format?

    • @sfdcstop
      @sfdcstop  3 ปีที่แล้ว +1

      Hi Archit, you're right you can use source format as well. SFDX is currently evolving, earlier source commands were mainly used to interact with scratch orgs and metadata commands were used to interact with sandboxes and production, now, you can also setup source tracking in sandboxes, so both the commands can be used. The difference is only that if you have the source tracking enabled, you will use push/pull commands and if you don't have that enabled, you'll use deploy/retrieve commands.
      Metadata commands were useful earlier when we used to work with sublime and mavensmate to interact with salesforce.

    • @sfdcstop
      @sfdcstop  3 ปีที่แล้ว +1

      You can use source format to deploy from one org to another it's completely fine. I mainly use it for deploying between scratch orgs as we have source tracking there so I am sure nothing is being overridden.

    • @architjain3157
      @architjain3157 3 ปีที่แล้ว

      @@sfdcstop Thanks a lot this gives me a better understanding!

    • @yatin1370
      @yatin1370 3 หลายเดือนก่อน

      @@sfdcstop I had the same doubt, glad to see its already answered. So do we still use mdapi commands in development for some cases or its all source now?

  • @jayagupta4775
    @jayagupta4775 3 ปีที่แล้ว

    22:46:24.87 Starting SFDX: Deploy Source to Org
    === Deploy Errors
    PROJECT PATH ERRORS how to fix

    • @sfdcstop
      @sfdcstop  3 ปีที่แล้ว

      Hi Jaya, can you share the exact error?