1

I have installed the feeds module and Feeds Database module so i can migrate contents inside my non drupal datase to a drupal 7 one. But i cant see the list of databases in the Feeds Database tab. Anyone can help?

Here's a code of my database in settings.php

$databases = array (
  'default' => 
  array (
    'default' => 
    array (
      'database' => 'karljay',
      'username' => 'root',
      'password' => '',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',
    ),

  ),
   'test' => 
  array (
    'test' => 
    array (
      'database' => 'joan',
      'username' => 'root',
      'password' => '',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',
    ),

  ),
);

this seems to be the right code cause i can see the test database now in the database's list in drupal but i have a database error when i import something using feeds. and here's my error

enter image description here

and to add more details here's my query

$q=msyql_query("SELECT subject from forumthreads");
$result=mysql_fetch_array($q);

and here's my mapping

enter image description here

i only have one field cause this is a test if i can really use feeds to migrate many data from other database

  • so why is this downvoted? what's wrong? – Belmark Caday Mar 27 '13 at 14:26
  • Your comments table does not have a column named 'thread'. Double check the spelling, and the table structure. – Triskelion Mar 27 '13 at 16:29
  • but i did not map the comments yet. how come? – Belmark Caday Mar 27 '13 at 16:29
  • What tables are you mapping from:to in the two databases? Have you defined any other mappings then deleted them (If so it may be related to this issue. – Triskelion Mar 27 '13 at 16:42
  • I just noticed the database definition 'test' => array ( 'test' =>. Change this to 'test' => array ( 'default' =>. (I know. Confusing!). – Triskelion Mar 27 '13 at 16:53
2

The documentation for this module is poor, but the solution is simple.

The module picks up the $databases array defined in your settings.php file. In most installations, only one database 'default' is defined. Use the format for 'default' and define a second database say 'test', listing the correct connection credentials. The 'test' database will show up in the drop down. The module removes 'default' from the list because it makes no sense to map a database to itself.

I think better documentation for Feeds Database is in order :). However, the core Database API can be configured for multiple databases. See Database Configuration.

  • hi again @Triskelion, i edited my post above cause i seem to have an error when i import the feeds. it seems to be a database problem so im guessing it's in the configuration of my added database. can you take a look if i did what you said correctly? – Belmark Caday Mar 27 '13 at 16:17
  • It appears to be correct from a Drupal standpoint. What is your error? – Triskelion Mar 27 '13 at 16:23
  • edited again, included my error – Belmark Caday Mar 27 '13 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.