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
Monika A 22Monika A 22 

If we enabled Dev Hub, will all the previous code or any data will dispose?

As per my inderstanding, If we enabled Dev Hub, it will be used as a scratch org.

So scratch org in the sense, all the data from the org will be disposed?Please confirm.
Thanks! 

Eden WheelerEden Wheeler
Enabling Dev Hub does not delete or remove any existing code or data from your Salesforce org. It simply allows you to create temporary scratch orgs for development and testing purposes. These scratch orgs start with a clean slate and do not include any pre-existing code or data from your main org. Your main org (production or sandbox) remains unaffected, and you can continue working on your code and data there as usual.
SwethaSwetha (Salesforce Developers) 
HI Monika,

Enabling Dev Hub in Salesforce does not dispose any previous code or data in your org. Dev Hub is a feature that enables you to create and manage Salesforce DX scratch orgs, which are temporary orgs for development and testing purposes.

When you enable Dev Hub, it provides you with additional capabilities and tools for managing your development process, such as creating scratch orgs, tracking and versioning changes with source control, and deploying code between orgs.

However, enabling Dev Hub does not impact your existing production or sandbox orgs, nor does it delete any code or data from your org. Your existing metadata, code, and data will remain intact unless you explicitly make changes or perform deployments using the Dev Hub features.

More in documentation: https://help.salesforce.com/s/articleView?id=sf.sfdx_setup_enable_devhub.htm&type=5

If this information helps, please mark the answer as best. Thank you