Greeting,

I'm trying to convert some data from php-fusion to Drupal. I succeeded in migrating users data. Now its time for news (only titles and body, comments are not really important). So I created a table in MySQL, imported data from php-fusion, made it looking like from drupal (all columns like in Drupal). I converted tables: node, field_data_body, field_revision_body. I thought that's all, but...

No nodes appear on main site (all are checked as published to homepage in database)
In content administration I see and can navigate via many pages: http://prntscr.com/edkgt but no content is visible
Trying to create new content I get error: http://prntscr.com/edkie (looks like somewhere is pointer which remember last id)

What I have to change to get it working? I suppose I missed some tables, right?

Comments

WorldFallz’s picture

Manipulating the db directly is not recommended unless you're very very very familiar with drupal and even then it should really be a last resort. You're better off creating a csv of the content you want to import and using the feeds module to actually import it. Alternatively, you could use the drupal api to progammatically create the nodes (but that's likely to take longer if you're unfamiliar with the api).

_
Care about the future of the Drupal.org forums? Please join our conversation and show support for improving the forums infrastructure.

Kapu’s picture

I tried feeds, but every time I get such error:
SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'last_comment_uid' at row 1
(I added a column with ID user to template in feeds)

If I try doing it on a raw Feeds configuration, with guid, title, body, published only it show that everythig has gone right, but I have imported only one, empty node... My CSV file looks like this: http://pastebin.com/7wuNkyRa
-EDIT-
After adding header line to the CSV file I get 1800+ items imported instead of 400, and couple of such errors:
SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'title' at row 1
Can be that caused by HTML in the body of imported data? But why some records are imported correcty, even with HTML, than some crash...

WorldFallz’s picture

Any time you're working with csv files or importing data the files have to be precisely created. A couple of things to check:

  • make sure the file is encoded utf-8
  • make sure the line endings match the system on which you run the import
  • make sure ALL the fields are enclosed in quotes
  • make sure all text is properly escaped and encoded
  • make sure any html is complete and correct (ie not missing closing tags)
  • make sure you have data in the file for any required fields
  • make sure the data match any limits of the fields (ie the 'title' too long error you mention above)

See #1156982: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'last_comment_uid' at row 1 for some examples of similar problems (i believe it even mentions the 'last_comment_uid' message).

_
Care about the future of the Drupal.org forums? Please join our conversation and show support for improving the forums infrastructure.

Kapu’s picture

Title wasn't too long, the CSV just broke somwhere and took other stuff as title. I'll try to check that everything, thanks. But might be hard if I had over 1600 records to import...