eltoroit / ETCopyData

SFDX Plugin to populate your scratch org and/or developer sandbox with data extracted from multiple sObjects.
113 stars 23 forks source link

Including 'Opportunity' object results in never-ending export #20

Closed JeroenSfdc closed 5 years ago

JeroenSfdc commented 5 years ago

Hi,

Great plugin, great potential. Wow.

But... I'm trying to export Opportunity, and the export hangs, as soon as I include the Opportunity object. If I've got only the Opportunity object included, then it exports just fine.

But e.g. when I add (e.g. it can be anything) Account, it hangs and takes full CPU.


    "now": "2019-06-18T23:34:16.390Z",
    "orgSource": "xxxx--core2",
    "orgDestination": "xxxx--dev1",
    "sObjectsData": [
        {
            "name": "Account",
            "ignoreFields": "",
            "maxRecords": 500,
            "orderBy": null,
            "where": null
        },
        {
            "name": "Opportunity",
            "ignoreFields": "Pricebook2Id,TF_NumberOfBlankRoles__c",
            "maxRecords": 1,
            "orderBy": null,
            "where": null
        }
    ],
    "sObjectsMetadata": [],
    "rootFolder": "./ETData",
    "includeAllCustom": false,
    "stopOnErrors": true,
    "ignoreFields": null,
    "maxRecordsEach": -1,
    "deleteDestination": false,
    "pollingTimeout": 100000
}```

```ltm4:EtCopyData jburgers$ sfdx ETCopyData:export --loglevel=trace
WARNING: apiVersion configuration overridden at "45.0"
Timestamp   #   Level   Line Number Description
23:34:16.362Z   1   TRACE   ETCopyData:42           Log level: trace
23:34:16.364Z   2   INFO    ETCopyData:44           ETCopyData:Export Process Started
23:34:16.385Z   3   INFO    Settings:402            Configuration value for [orgSource]: xxxx--core2
23:34:16.386Z   4   INFO    Settings:402            Configuration value for [orgDestination]: xxx--dev1
23:34:16.386Z   5   INFO    Settings:402            Configuration value for [stopOnErrors]: true
23:34:16.387Z   6   INFO    Settings:402            Configuration value for [rootFolder]: ./ETData
23:34:16.387Z   7   INFO    Settings:402            Configuration value for [maxRecordsEach]: -1
23:34:16.387Z   8   INFO    Settings:402            Configuration value for [pollingTimeout]: 100000
23:34:16.387Z   9   INFO    Settings:311            Configuration value for [sObjectsData]: 2 sObjects found.
23:34:16.388Z   10  INFO    Settings:321            Configuration value for [sObjectsMetadata]: 0 sObjects found.
23:34:16.392Z   11  TRACE   ETCopyData:318          Configuration settings read.
23:34:16.454Z   12  INFO    OrgManager:34           [xxxx--core2] Alias for username: [xxxx@xxxx.com.core2]
23:34:17.725Z   13  TRACE   SchemaDiscovery:262     [xxxx--core2] Found sObject [Account].
23:34:17.727Z   14  TRACE   SchemaDiscovery:262     [xxxx--core2] Found sObject [Opportunity].
23:34:19.087Z   15  INFO    OrgManager:34           [xxxx--dev1] Alias for username: [xxxx@xxxx.com.dev1]
23:34:20.189Z   16  TRACE   SchemaDiscovery:262     [xxxx--dev1] Found sObject [Account].
23:34:20.191Z   17  TRACE   SchemaDiscovery:262     [xxxx--dev1] Found sObject [Opportunity].
23:34:21.650Z   18  WARN    ETCopyData:289          There are some *field* differences between the orgs.
23:34:21.652Z   19  WARN    ETCopyData:293          If the following fields do exist in the org, then check security (FLS) because they could be hidden, but for now those fields will be ignored.
23:34:21.652Z   20  WARN    ETCopyData:298          [xxxx--core2] Field [Account.OwnershipChangeStatus__c] does not exist in [xxxx--dev1].
23:34:21.653Z   21  TRACE   SchemaDiscovery:106     [xxxx--core2] Field [Account.OwnershipChangeStatus__c] ignored because Org mismatch```

Regards,

Jeroen
eltoroit commented 5 years ago

Did you read the last 3 lines of that log? Check the fields and FLS.

Also, are there any circular dependencies (lookup/master-details)? A => A? (Is the sObject A a child of sObject A? or A=> B and B => A? This version of ETCopyData does not handle circular references. #17

JeroenSfdc commented 5 years ago

Thnx for replying.

The last three lines are a warning, right? OwnershipChangeStatus__c is non-existent in the target org. But exporting just Account is fine.

Account has a ParentId, do I need to exclude that? Opportunity does not have circular references.

eltoroit commented 5 years ago

Yes, it's a warning which may be ignored.

Please ignore (ignoreFields) the ParentId field on the Account

JeroenSfdc commented 5 years ago

I'll look at this issue a later time again, will close for now.