As I was not able to find any working way of importing content from csv, I decided to export it to .csv from the old site (database) and import it then into the Drupal 8 database. However, after I updated tables node
, node__body
and node_field_data
I was not able to access the content overview page anymore.
1 Answer
Turned out that I also had to update node_revision
table, so all I have done was:
node
(D7) -> node
(D8)
select nid,vid, 'article', UUID(), language
from node
where type = 'story'
field_data_body
(D7) -> node_body
(D8)
select 'article', null, entity_id, revision_id, language, 0, body_value, body_summary, 'basic_html'
from field_data_body
where bundle = 'story'
node
(D7) -> node_field_data
(D8)
select nid, vid, 'article', language, status, title, uid, created, changed, promote, sticky, 1, 1
from node
where type='story'
node
(D7) -> node_revision
(D8)
select nid, vid, language, created, uid, null, 1
from node
where type='story'
node
(D7) -> node_field_revision
(D8)
select nid, vid, language, status, title, uid, created, changed, promote, sticky, null, language
from node
where type='story'
Of course, these are just simple queries for just one particular article type without any additional fields, but the point was to show which tables need to be updated to at least get the content in the Drupal 8. Other (field) tables will require more sophisticated SQL exports.