Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

d7_import

4 sites No security coverage
View on drupal.org

# D7 Content Import

A Drupal 10/11 module for importing content exported from Drupal 7 sites.

## Overview

This module provides a way to migrate content from Drupal 7 to Drupal 10/11 without going through the standard D7 → D8 → D9 → D10 → D11 migration path. It works by:

1. Exporting content from D7 as XML files (using the included export script)
2. Importing the XML files into D10/11 (using this module)

## Features

- Preserves node IDs (NIDs), term IDs (TIDs), and file IDs (FIDs)
- Auto-creates vocabularies and content types from the import data
- Auto-creates fields based on D7 field types
- Imports taxonomy terms with hierarchy
- Imports files and file references
- Imports URL aliases

## Installation

1. Copy the `d7_import` folder to your D10/11 site's `modules/custom` directory
2. Enable the module: `drush en d7_import`
3. Access the import form at `/admin/content/d7-import`

## D7 Export

Before importing, you need to export your D7 content:

1. Copy `d7_export_script/export_content.php` to your D7 site root
2. Run with Drush (for multisite, specify the site):
```bash
drush -l yoursite.com php-script export_content.php
```
3. Find the exported XML files in `sites/default/files/export/[site_name]/`

## Import Process

The import should be done in order:

1. **Vocabularies** - Creates empty vocabulary entities
2. **Terms** - Populates terms with preserved TIDs
3. **Content Types/Fields** - Creates node types and field configurations
4. **Files** - Creates file entities with preserved FIDs
5. **Nodes** - Creates nodes with preserved NIDs
6. **Aliases** - Creates URL path aliases

## Field Type Mapping

| D7 Field Type | D11 Field Type |
|---------------|----------------|
| text | string |
| text_long | text_long |
| text_with_summary | text_with_summary |
| image | image |
| file | file |
| taxonomy_term_reference | entity_reference |
| entityreference | entity_reference |
| link_field | link |
| date/datetime/datestamp | datetime |
| list_text | list_string |
| list_integer | list_integer |
| list_boolean | boolean |
| number_integer | integer |
| number_decimal | decimal |
| number_float | float |

## Source Files Path

If you want to copy the actual files (images, documents, etc.) during import, provide the path to your D7 files directory in the import form. For example:

```
/var/www/d7site/sites/default/files
```

Leave empty to only create file entities without copying files.

## Limitations

- Users are not imported (nodes are assigned to UID 1 if original user doesn't exist)
- Revisions are not imported
- Some complex field types may need manual handling
- Text format names must match between D7 and D11 (or will default to `basic_html`)

## Troubleshooting

### Entity ID conflicts
If you get errors about duplicate IDs, the import will skip those items. Run the import again to retry failed items.

### Field type not supported
Check the logs for "unknown type" messages. You may need to extend `FieldTypeMapper.php` for custom field types.

### Memory issues with large imports
For sites with thousands of nodes, consider importing in batches or increasing PHP memory limit.

## Contributing

This module is intended to be contributed to Drupal.org. Feedback and patches welcome!

## License

GPL-2.0-or-later

Activity

Total releases
1
First release
Jan 2026
Latest release
2 months ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
1.0.1 Stable Jan 25, 2026