# Creating a Template for Salesforce Sandbox Seeding

Salesforce provides a sandbox that you can use for testing and demo purposes. You can populate, or "seed," the sandbox with a Commvault backup from your production Salesforce data or another Salesforce sandbox. Data is restored from a local (sync) database.

After you have set up a sandbox, you can make customizable and reusable templates for repeatedly seeding it with the data you need. You can apply a data-masking policy to a template or select one when performing the seeding operation.

Here are some important points to remember about sandbox seeding:

- Seeding is always performed from the latest backup.

- If a masking policy is attached to a template, it will always be used.

- If a masking policy is not attached, any can be used during seeding.

- As of SP32, plain-text SQL WHERE clauses are no longer supported.

- Child objects are limited to 1000 per rule, per driving object.

- The WHERE clause filter is not available when a rule has more than one object during creation.

## Procedure

1. From the Command Center navigation pane, go to Protect > Salesforce.

   The Salesforce Overview page appears.

2. Go to the Organizations tab.

3. In the Name column, click the app.

   The app details page appears.

4. On the Sandbox seeding tab, click Create new to create a new template.

   The Add sandbox seeding template page appears.

5. Enter a name for the template.

6. (Optional) Select a data masking policy.

7. For each object that you want to seed, add a corresponding rule. To add the first rule, click Add next to the Objects grid.

   The Add Rule dialog box appears.

8. From the object list, select the objects for the rule. One, multiple, or all objects can be selected.

9. In the next dropdown, select a rule:

   - All records: To seed all available records for the object in the latest backup.

   - Most recently updated N records: With this option selected, specify the number of records, N in the Number of records box.

   - Records updated in last N days: With this option selected, specify the number of days, N in the Last N days box.

   - SQL Where clause: To define an advanced SQL filter, using a combination of rules and rule groups.

10. To include parent objects in the restore, move the Restore parent object records toggle to the right.

    Important

    Including parent objects has the following effects:

    - Data integrity is maintained. If parent objects are included and some parents do not exist or some parents have incorrect values, the restore still completes.

    - When objects such as User objects are updated, end users receive notifications, which may be undesirable.

11. To include dependent objects in the restore, move the Restore dependent object records toggle to the right and then select Immediate or All for Dependent object level.

    By default, the Commvault software selects all the dependent objects based on your selection for Dependent object level. From the Included dependent objects list, you can select the dependent objects that you want to include in restore.

12. Click Add rule.

    If you added multiple objects, each has its own row. Add more rules as needed.

    To view the records for an object, click the action button , and then Preview.

13. Click Save.

    Templates can be edited, cloned, or deleted on the Sandbox seeding tab. To seed a template to a sandbox organization, click the action button , and then click Seed sandbox.

×

Loading...