function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kunal Purohit 4Kunal Purohit 4 

How to get installed packages of production org to scratch org?

Hello All,
I have cretaed scratch org from production org. But now production org features such as installed packages are not getting displayed in scratch org. Could anybody help me to achieve the same? 
Best Answer chosen by Kunal Purohit 4
SwethaSwetha (Salesforce Developers) 
HI Kunal,
SFDX does not provide a way to create a scratch org that is an exact replica of your production instance. Each scratch org starts out empty so you will need to migrate your custom modifications manually. 

You can install packages with the sfdx force:package:install command in scratch org . You can specify the dependencies of a package in the sfdx-project.json file.However, this does not install packages in your scratch org when you create it automatically.

Check out this useful post https://salesforce.stackexchange.com/questions/198080/installing-managed-packages-to-scratch-org-via-configuration relevant to your scenario.

https://salesforce.stackexchange.com/questions/195668/scratch-org-definition-install-managed-package

I have not implemented myself but you might also want to try the Org Shape(Beta) feature.
https://developer.salesforce.com/docs/atlas.en-us.228.0.sfdx_dev.meta/sfdx_dev/sfdx_dev_shape_create_shape.htm


Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you