Problem/Motivation

Drupal 9 uses Drush 10, currently the Drush commands that content sync support are for Drush 9.
Include the compatibility for Drush 10 commands.

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

Blanca.Esqueda created an issue. See original summary.

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

guido_s’s picture

I'm working with drush commands the first time here so I'm not 100% sure what needs to be checked and done in total.
I checked the Drush 12 documentation for this as drush 12 is in use on Drupal 10.

Things I've done so far to give you a starting point to work with:

  • Changed folder structure and file name (also in drush.services.yml)
  • Completed the create method as many of the containers were missing
  • Fixed PHP Code Sniffer issues
  • Used PHP Attributes instead of Annotations as Drush recommends using this if PHP 8+ is used

I didn't change any code inside the functions (apart from phpcs fixes).

I'm not sure about the requirements that need to be set in composer.json

Proper usage description for the commands is still missing.

I'm also not sure if some of the function code can be improved or needs to be changed since drush introduced new functions for yaml files for example.

guido_s’s picture

guido_s’s picture

Status: Active » Needs work

guido_s’s picture

I tried using a drush command with this merge request applied and the drupal 10 compatibility issue merge request applied, but it seems this is not working correctly yet.

cli-drupal:/app$ drush cse --entity-types=node --files=base64
Differences of the active content to the export directory:

+------------+--------------+-----------+
| Collection | Content Name | Operation |
+------------+--------------+-----------+

 Do you want to export? (yes/no) [yes]:
 >

It never shows any differences although I never exported any content (also skipped the snapshot on installation as it would take hours to enable the module). Exporting and importing single content items via the UI seems to work fine though.

simonbaese’s picture

blanca.esqueda’s picture

Version: 3.0.x-dev » 4.0.x-dev
Status: Needs work » Reviewed & tested by the community

I tried the code on the MR with Drush version : 12.5.3.0
and it works good for me.

Followed the next steps:

  • set the content/sync folder
  • installed/enabled the module -- as it was a new site it had only a couple of users - but the snapshot was skipped.
  • used the drush command to export the content
  • duplicated one of the YML, updated the uuid on the name and content and a couple of properties.
  • used the drush command to import the content.

Also tried the single import/export using the UI

blanca.esqueda’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.