- Issue created by @nginex
- @artycal opened merge request.
- Assigned to nginex
- Status changed to Needs review
almost 2 years ago 2:31pm 21 April 2023 - π¬π§United Kingdom reece.oliver
Hey @artycal, may I request a feature to be added into these drush commands? I see that you have added the ability to export specific entity ids do you think it would be possible to add to the import commands the ability to import to a specific entity id as well?
My use case is that I have two sites and the entity IDs of say A basic page that is present on both sites may not necessarily be the same but the content is. This would be helpful because i could make changes on my "dev" site to the basic page and then I could export and import those changes to my "prod" site to the basic page which has a different ID.
I think this would a useful feature to add as from my experience if you haven't used a content sync module in the past and have been copying changes over sites manually your node/entity ids wouldn't necessarily link up if created in different orders
- π§πͺBelgium artycal
Hi @reece.oliver
If I understand your request correctly, you want to be able to import content from an export into another entity that doesn't necessarily have the same entity id.
I can see the value in that, but this is is better moved to a separate issue, as it is not only related to the drush commands, but could also be a good general functionality to have in the ui too
- π§πͺBelgium artycal
@reece.oliver
An alternative approach for your issue might be to downsync your live database to your dev environment. In that case, the uuid's will match up, and then any changes exported from dev to live shouldn't be a problem.Replacing uuid's is possible, but there is the issue of how to handle any references that the content may provide, as there might be duplicates if those are also using a different uuid.
Or there might be references to the wrong content, if there is a uuid that on the dev that is in use by some other content on the live environment. - π¬π§United Kingdom reece.oliver
Yes you understood correctly. Okay I understand, so many variables to think about here. The sql sync command didn't cross my mind I shall look further into this and see if that can circumvent this problem for me. Thank you for your help :)
- πΊπΈUnited States cameron prince
I've been testing this, but had to re-roll the patch. It looks like it's either outdated or it's trying to patch on top of another patched version instead of origin.
The export ran without error and the zip file was created when testing with about 10 nodes. The import fails with a
AssertionError: Cannot load the "file" entity with NULL ID.
error. I think this may be related to my setup.I'm going to test again on another environment and will report back.
- πΊπΈUnited States cameron prince
We tested this again today on the servers where the source images are and it worked well. I believe this will be ready for RTBC once the MR is updated so the patch applies.
- Status changed to RTBC
over 1 year ago 1:33am 27 May 2023 - πΊπΈUnited States mortona2k Seattle
The latest MR applies and the drush export/import from zip is working, with content entity ids.
@cameron prince I was getting that error when it was in my private directory, but it is working in public.
- Issue was unassigned.
- Status changed to Needs work
over 1 year ago 3:10pm 3 June 2023 - πΊπ¦Ukraine nginex
Hi @artycal,
Thanks for the patch, please fix my notes to move on with this issue.
- Status changed to Needs review
over 1 year ago 1:32pm 4 June 2023 - Status changed to Needs work
over 1 year ago 10:55am 4 July 2023 - π·πΊRussia qzmenko Novosibirsk
Thanks for the work! Please check my notes to MR.
- π§πͺBelgium artycal
@Kuzmenko Thanks for your work on this.
I propose to also add an interface for the helper class.
Will need to investigate the DRUPAL_ROOT alternative to the $this->requestStack->getCurrentRequest()->server->get('PWD') - π§πͺBelgium artycal
Took another look at this.
I don't think we should be using the DRUPAL_ROOT approach for the outputpath. It should be using relative path as it was before. Rather than changing the result to a path from the DRUPAL_ROOT, it should be investigated how to make that relative path work for all users. It also doesn't make much sense to me to use DRUPAL_ROOT, as the fall back for a NULL in $this->requestStack->getCurrentRequest()->server->get('PWD') was already the default export location. - πΊπΈUnited States SamLerner
I just pulled down this branch and it looks like the DRUPAL_ROOT and/or
get->('PWD')
solutions are replaced with things like$grandparent_path = \Drupal::root();
Can we consider that issue resolved? I also went through the unresolved issues in the MR, and it looks like they were fixed weeks ago.
I recently tested the drush commands to export a page in Layout Builder with multiple uploaded images, and both the import and export worked like a charm on my Drupal 9.5.10 site. What needs to happen next to get this merged?
- Assigned to nginex
- Status changed to Needs review
over 1 year ago 8:14am 7 August 2023 - π§πͺBelgium artycal
We have decided to go with the Drupal::root() approach after all. So this can be considered resolved after review.
Hello, I tried applying the latest patch locally to my Drupal installation which is successful. The web/modules/contrib/single_content_sync reflects the updated files and folders. The issue that I am facing is that drush is unable to recognize the Commands. However, It recognizes commands from all the other contrib modules. I am using drush 10.6.2 and Drupal 9.5.9. Am I missing something here? Thanks in advance!
- @mortona2k opened merge request.
- πΊπΈUnited States dblanken Carmel, Indiana
I was able to test merge !59 and it is working great locally. I am so psyched to see this Drush command and how flexible this project is that it can handle other exports like media and taxonomy_terms. Thank you so much for your work on this, and great job on this project as a whole!
- Status changed to RTBC
over 1 year ago 2:59pm 8 September 2023 - πΊπΈUnited States SamLerner
I tested !59 as well and it's working great for me on Drupal 9.5.10. Setting to RTBC.
@yashsk8 did you try cloning the repo and checking out MR !59 instead of applying a patch? After doing that and running
drush cc drush
I saw thecontent:export
andcontent:import
commands listed in the drush status. -
nginex β
committed 22590de0 on 1.4.x authored by
mortona2k β
Issue #3345288: Provide a drush command to export/import content
-
nginex β
committed 22590de0 on 1.4.x authored by
mortona2k β
- Issue was unassigned.
- Status changed to Fixed
over 1 year ago 8:15pm 13 September 2023 - πΊπ¦Ukraine nginex
What a great work guys, love it so much, thank you all
Automatically closed - issue fixed for 2 weeks with no activity.