2

I have the Production environment with full of unwanted configuration. I have developed and developing things in my Sandbox environment and I will start pushing that to production later sometime next week.

But, I want to clean the entire data in the Production environment. Is there an easy way to do it?

Basically I am configuring the new data from the scratch. I am doing that in the Sandbox. I don't need the existing data in Production.

3
  • There is no "easy" way to do this. It's a large, time-consuming process. It's rare when I say something like this, but your best bet is to hire a consultant. This is one of those things that only gets easier with experience.
    – sfdcfox
    Jan 5, 2017 at 16:11
  • Make a backup first!
    – Jagular
    Jan 5, 2017 at 16:22
  • basically i am configuring the new data from the scratch. I am doing that in the sandbox. i don't need the existing data in the production. Thank you
    – abhi
    Jan 5, 2017 at 16:23

1 Answer 1

4

"Easy" is subjective, but there is a way to do it. Given you made the following comment:

basically i am configuring the new data from the scratch. I am doing that in the sandbox. i don't need the existing data in the production. Thank you

I'm going to assume you don't want any data in production, only the data in sandbox as a consequence.

Truncating your Tables

To remove data from an object, the easiest way is to "truncate" your objects. You can find more information about that here. The long and short of it is to enable a special permission by going to:

Setup > Customise > User Interface

And select Enable Custom Object Truncate. Now when you go to:

Setup > Create > Objects

And go to an object, you should see a button that says Truncate. Don't quote me on this, but what this seems to do is create a duplicate of the object with the same API names/meta data etc... and "renames" the current object to one marked for deletion.

You just need to do this for all your objects. I believe this happens after 2 weeks, but Salesforce gives you a "warning" about this when you go to truncate. This is important when considering Storage Usage.

Exporting Data

You can't migrate records from a sandbox to production, so what you'll need to do is export data from Sandbox. There's a couple of ways to do this and some documentation here, personally I'd advise using the Data Loader.

The Data Loader is a separate application you can download from:

Setup > Administer > Data Management > Data Loader

The long and short of this is:

  1. Open the Data Loader
  2. Click Export
  3. Log In
  4. Choose an Object
  5. Choose a Location to Export to
  6. Create a SOQL query for the data export

Importing Data

You can, again, use the Data Loader to do this or you can use the Data Import Wizard.

Or, you can access the browser based Data Import Wizard from:

Setup > Administer > Data Management > Data Import Wizard

Both do the same thing although I personally prefer using the Data Loader of the Data Import Wizard, but essentially both processes are the same:

  1. Log in (either to Salesforce via your Browser for the Data Import Wizard or via the Data Loader (don't forget to append your security token to your password if you use the Data Loader))
  2. Select a Spreadsheet
  3. Select an Object
  4. Map the columns to fields
  5. Go!

Salesforce will then effectively batch execute DML on records, by default doing 200 at a time.

1
  • Truncating the custom objects leaves the objects API's. Looks like i have to manually erase the custom objects and metadata and all.
    – abhi
    Jan 5, 2017 at 19:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .