Problem/Motivation

By default all dependencies are fully exported. Sometimes it's a huge export when you just want to export a small piece of content e.g. you already exported all dependencies or you don't need them at the moment, and you just wanted to sync one page instead of all dependencies.

The idea is to add a checkbox to export form and an option to drush command that will allow user to fully or partially export the content.

Probably the easiest way will be to exclude all entity reference fields from the export, so when importing these fields will be untouched.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nginex created an issue. See original summary.

nginex’s picture

Issue tags: +LutskGCW25

supreetam09 made their first commit to this issue’s fork.

supreetam09’s picture

Status: Active » Needs review

This is something we also needed. In our project, there are some content, for which the dependency tree is so huge that the Export page throws 500 PHP out-of-memory error, even with setting memory_limit to -1

We implemented the code from the MR. It introduces a new settings key which will be used to identify entity types that will be omitted from the export list for referenced entities. We had to exclude all node entity type references from content (other entity reference dependencies are still there) - and Export page started opening fine.

Its now exporting importing partially and with the settings, we can control it.

Although I understand that this is not perfect. We can further fine tune the control. Currently its entity level control - but I can think of more ways like bundle level control or hierarchy level control (like 1st child node reference will be exported but another node referenced to the 1st child i.e. child's child won't be exported).

For now, I am adding a starting point.

Let me know your thoughts!

nginex’s picture

Thanks for the patch, I will check and test it when I get some time. Meanwhile you can also test similar issue but with different solution here

https://www.drupal.org/project/single_content_sync/issues/3511539#commen...

supreetam09’s picture

StatusFileSize
new14.13 KB

Unfortunately the patch from MR does not apply on current stable version 1.4.10 as there's been too many changes in 1.4.x. I am adding a patch only for 1.4.10 release.
Consider the MR for the dev branch.

nginex’s picture

I'm planning to create 1.4.11 during a week, so already merged a few issues

bhagyalakshmi’s picture

StatusFileSize
new23.46 KB

Still the patch does not apply on current stable version 1.4.11. I am getting the below error while applying this patch. Any one can help me on which version it will apply.

patch error

bhagyalakshmi’s picture

I can able to add patch on 1.4.10 version.
I have skipped all the referenced entity types except "content" in advanced settings. But, I am still getting timeout error.
settings:
settings

Error:
error

In my application, we have a content with more paragraph components with multiple fields.
Using this patch we can add settings in global level, is there any way to exclude the components on content level while exporting.
please advise.

nginex’s picture

I improved patch in #3511539: Recursion takes too much memory compared to earlier versions (1.4.6 or earlier), would be nice to test it

I think the main performance issue is in related node menu Link, embedded entities from formatted text, embedded entities from link fields.

The patch above should handle it for complex sites.

namisha jadhav’s picture

I have created a PR from https://git.drupalcode.org/project/single_content_sync/-/merge_requests/... to make it compatible with 1.4.14 version. This PR is to allow partially export content.

namisha jadhav’s picture

StatusFileSize
new12.81 KB
jannakha’s picture

Status: Needs review » Needs work

Recent release has introduced merge conflicts.
Please resolve merge errors.

hemuvyas97’s picture

Re-rolled the patch from #13 for version 1.4.19.

hemuvyas97’s picture

StatusFileSize
new12.37 KB

Updated patch for the version 1.4.19.