Drush Commands
Export Drupal Content to a Directory.
drush content-sync:exportAliases
content-sync:export has 2 aliases:
drush content-sync-export
drush cseOptions
content-sync:export accepts the following options:
--entity-types
A list of entity type names and bundles separated by commas.
(i.e. user, node.article, node.page)
--uuids
A list of UUIDs separated by commas.
--actions
A list of Actions separated by commas.
Values: update, create, delete
--files
A value option to export media/files.
Values: none, base64, folder
--include-dependencies
Export the content dependencies.
--skiplist
Skip displaying the change list before proceeding with the export.
--compare-dates
Creates the export change list with source content that is newer than the target content, using the changed date for comparison.
(if the source and target content are different, the export will only use the source content if they are newer that the target content ).
Examples
- Export the entire site content entities; Save files in the content folder defined in settings.php.
drush content-sync:export- Export content entities of type user and node; Save files in the content folder defined in settings.php.
drush content-sync:export --entity-types=user,node- Export content entities of type node and bundle article; Save files in the content folder defined in settings.php.
drush content-sync:export --entity-types=node.article- Export content entities of type file and its base64 data; Save files in the content folder defined in settings.php.
drush content-sync:export --entity-types=file --files=base64
- Export a content entity with uuid [UUID]; Save the file in the content folder defined in settings.php.
drush content-sync:export --uuids=[UUID]- Export a content entity with uuid [UUID] including content dependencies; Save files in the content folder defined in settings.php.
drush content-sync:export --uuids=[UUID] --include-dependencies- Export content entities that exist in the active storage but not in the content folder; Save files in the content folder defined in settings.php.
drush content-sync:export --actions=createImport Drupal Content from a Directory.
drush content-sync:importAliases
content-sync:import has 2 aliases:
drush content-sync-import
drush csiOptions
content-sync:import accepts the following options:
--entity-types
A list of entity type names and bundles separated by commas.
(i.e. user, node.article, node.page)
--uuids
A list of UUIDs separated by commas.
--actions
A list of Actions separated by commas.
Values: update, create, delete
--skiplist
Skip displaying the change list before proceeding with the export.
--compare-dates
Creates the import change list with source content that is newer than the target content, using the changed date for comparison.
(if the source and target content are different, the import will only use the source content if they are newer that the target content ).
Examples
- Import the entire site content entities from the content folder defined in settings.php.
drush content-sync:import- Import content entities of type user and node from the content folder defined in settings.php.
drush content-sync:import --entity-types=user,node- Import content entities of type node and bundle article from files in the content folder defined in settings.php.
drush content-sync:import --entity-types=node.article- Import content entities of type file from files in the content folder defined in settings.php.
If there is a 'files' folder inside the content folder, then the file will be copied to the correct location.
If the file includes base64 data, then the file (i.e. image) will be created.
drush content-sync:import --entity-types=file
- Import a content entity with uuid [UUID] from the file in the content folder defined in settings.php.
drush content-sync:import --uuids=[UUID]- Import content entities that exist in the content folder but not in the active storage.
drush content-sync:import --actions=createHelp improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion
Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.