I am trying to migrate community configurations from one scratch orgs to another. Everything works fine except ContentAsset.

I am getting the following error:-

PS E:\Projects\xxxxx-build test> sfdx force:source:push -u xxxxxBuild
PROJECT PATH                                                
ERROR──────────────────────────────────────────────────────────  ────────────────────────────────────────────────────────────────────────────────────────
force-app\main\default\contentassets\xxxxxkeyvisual.asset  ContentAsset xxxxxkeyvisual [03S1X00000007Zx] - No Network named [xxxxx_partner] (0:0)
force-app\main\default\contentassets\xxxxxkeyvisual.asset  This record isn't in the target org: xxxxx_partner. (0:0)
force-app\main\default\contentassets\logoxxxxx.asset      ContentAsset logoxxxxx [03S1X00000007Zy] - No Network named [xxxxx_partner] (0:0)
force-app\main\default\contentassets\logoxxxxx.asset      This record isn't in the target org: xxxxx_partner. (0:0)
ERROR running force:source:push:  Push failed.

I checked my directory and found that xxxxx_partner network is already available there.

If anyone have idea deploying community please suggest the solution. I am attaching a screenshot of the directory structure.

enter image description here

Thanks in advance.


Follow these steps:

  1. You need to first create a community in target org with same name and url.

2.Then rename it to something else and rename it back to the original community name.

And then deploy the code.
Step 2 is needed because of a issue with network naming convention.

If you will check the network xml file the network name has a __c sufix while when you create the community for the first time this sufix is not there.

Hope it helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.