# Import & Export

Some of the data used by this plugin - namely, Fieldmaps, Object Maps, and Plugin Settings - can be imported (from a .json file) and exported (to a .json file).

While this feature is mostly intended for developers at this time, non-developers will possibly find it useful, for example to back up plugin data.

You can use this feature from the Import &amp; Export tab in the plugin's settings.

## Importing

### In the WordPress plugin's admin screen

When importing data to this plugin, you need a .json file that has been created by this plugin's export feature, or by hand to match its format.

Once you have one, any data that you can export (defined below) can also be imported. If you check the Overwrite existing data checkbox, any matching data will be overwritten.

Using this feature should not be risky to your WordPress install in general, but you should always back up your database before doing something like this. Especially if any part of this plugin is already working, as this could be affected by the import.

If you intend to do any hand coding of JSON for importing, you should export the JSON first, with as much configuration as possible, so you can see how it is formatted. Much of the data that gets stored in the JSON is autogenerated based on responses from the Salesforce API, while other parts are stored as you go through the process of setting up the plugin.

### In Salesforce

To update a bulk set of data in Salesforce so that this plugin will detect changes, consider this WordPress [support forum answer](https://wordpress.org/support/topic/can-import-all-the-user-from-salesforce-to-wordpress/#post-13817998):

> I’ve been able to import all existing data from any Salesforce objects by using System Modstamp as the date field to trigger pulls, then running a very simple anonymous APEX statement that updates all of the timestamps on the object in Salesforce. Basically, the plugin is watching for updates to Salesforce records so you just need to make them all appear to have been updated, even if nothing really changed other than the date that Salesforce thinks the record was last updated. Of course, you’ll want to be sure that updating the Modstamp won’t cause issues in your org (if it’s being used for some business reason), but I don’t think it’s likely that it would.

> Here is Apex code that will update all of the System Modstamps in a custom object called objectList (objectList__c):

``` java
List<customobject__c> objectList = [select id from customobject__c];
update objectList;
```

> You can use the Salesforce Developer console to execute this, or I like to use a tool (no affiliation with) called FustIT SFDX Explorer that makes it a little easier for me to do this than the Developer Console.

## Exporting

When exporting, you can include any or all of the following data:

- Fieldmaps: this will include all of the data that matches a WordPress object to a Salesforce object.
- Object Maps: this will include all of the individual maps between WordPress and Salesforce data records.
- Plugin Settings: this is the plugin's settings. You probably don't want to make this public, since it may contain Salesforce API keys.
