Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Drupal 6 to Vanilla, error on Drupal Export

This discussion is related to the Vanilla Porter addon.

I'm getting an error when exporting from Drupal 6 using Vanilla porter. I use the advanced forum module in D6 so I'm wondering if that's causing problems?
7. The error I am getting is:

   select n.*, nullif(n.changed, n.created) as DateUpdated, f.tid, r.body
     from nodeforum f
     left join node n
        on f.nid = n.nid
     left join node_revisions r
        on r.nid = n.nid;Table 'databasenamegoeshere.nodeforum' doesn't exist

Error: (1024) Table 'databasenamegoeshere.nodeforum' doesn't exist

Any idea what I've done wrong? thanks!

Comments

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    Just a wild guess: you either have to do a search and replace for "databasenamegoeshere" or specify anywhere the name of your database ;)

  • ukcukc New
    edited December 2014

    The Drupal section of the Vanilla Porter script is not functional. Here's what I have so far, and it seems to work mostly. Still needs quite a bit of testing, so take it with a pinch of salt. You need to replace the whole Drupal class in the script, starting at line 3590.

    (Don't know why the first few lines are not formatting properly. Make sure you don't include the "`" which is in front of the first class statement. That is supposed to be the forum delimiter for text formatted as code.)

    class Drupal extends ExportController {
    
       /** @var array Required tables => columns */  
       protected $_SourceTables = array();
       
       /**
        * @param ExportModel $Ex
        */
       
       protected function ForumExport($Ex) {
          $this->Ex = $Ex;
    
          // Get the characterset for the comments.
          $CharacterSet = $Ex->GetCharacterSet('comment');
          if ($CharacterSet)
             $Ex->CharacterSet = $CharacterSet;
    
          // Begin
          $Ex->BeginExport('', 'Drupal');
          
          // Users
          $User_Map = array(
             'uid'=>'UserID',
             'name'=>'Name',
             'Password'=>'Password',
             'mail'=>'Email',
             'photo'=>'Photo',
             'created'=>array('Column' => 'DateInserted', 'Filter' => 'TimestampToDate'),
             'login'=>array('Column' => 'DateLastActive', 'Filter' => 'TimestampToDate')
          );   
          $Ex->ExportTable('User', "
             select u.*,
                nullif(concat('drupal/', u.picture), 'drupal/') as photo,
                concat('md5$$', u.pass) as Password,
                'Django' as HashMethod
             from :_users u
             where uid > 0", $User_Map);
          
          // Signatures.
          $UserMeta_Map = array(
              'uid' => 'UserID',
              'Name' => 'Name',
              'signature' => 'Value');
          $Ex->ExportTable('UserMeta', "
             select u.*, 'Plugins.Signatures.Sig' as Name
             from :_users u
             where uid > 0", $UserMeta_Map);
          
          // Roles.
          $Role_Map = array(
              'rid' => 'RoleID',
              'name' => 'Name');
          $Ex->ExportTable('Role', "select r.* from :_role r", $Role_Map);
          
          // User Role.
          $UserRole_Map = array(
              'uid' => 'UserID',
              'rid' => 'RoleID');
          $Ex->ExportTable('UserRole', "
             select * from :_users_roles", $UserRole_Map);
    
          // Categories
          $Category_Map = array(
             'tid'=>'CategoryID',
             'parent'=>'ParentCategoryID',
             'name'=>'Name',
             'description'=>'Description',
             'Depth'=>'Depth'
          );
          $Ex->ExportTable('Category', "SELECT t.tid,
            IF(h.parent = 0, -1, h.parent) AS parent,
            t.name,
            t.description,
            IF(h.parent = 0, 1, 2) AS Depth
            FROM :_term_data t
            JOIN :_vocabulary v ON t.vid = v.vid
            JOIN :_term_hierarchy h ON t.tid = h.tid
            WHERE v.module = 'forum'", $Category_Map);
    
          // Discussions
          $Discussion_Map = array(
             'nid'=>'DiscussionID',
             'tid'=>'CategoryID',
             'uid'=>'InsertUserID',
             'title'=>'Name',
             'body' => 'Body',
             'created' => array('Column' => 'DateInserted', 'Filter' => 'TimestampToDate'),
             'DateUpdated' => array('Column' => 'DateUpdated', 'Filter' => 'TimestampToDate'),
             'Format'=>'Format',
             'sticky' => 'Announce'
          );
          $Ex->ExportTable('Discussion', "SELECT n.*, nullif(n.changed, n.created) as DateUpdated, t.tid, r.body,
            'Html' AS Format,
            0 AS Closed,
            FROM_UNIXTIME(n.created) AS DateInserted
            FROM :_node n
            JOIN :_node_revisions r ON n.nid = r.nid AND n.vid = r.vid
            JOIN :_term_node t ON n.nid = t.nid
            WHERE n.type = 'forum'",
            $Discussion_Map);
                
          // Comments.
          $Comment_Map = array(
              'cid' => 'CommentID',
              'nid' => 'DiscussionID',
              'uid' => 'InsertUserID',
              'comment' => array('Column' => 'Body'),
              'hostname' => 'InsertIPAddress',
              'timestamp' => array('Column' => 'DateInserted', 'Filter' => 'TimestampToDate')
          );
          $Ex->ExportTable('Comment', "
             select c.*,
                n.title,
                'Html' as Format
             from comments c
             join node n
                on c.nid = n.nid", $Comment_Map);
          
          $Ex->EndExport();
       }
    
  • LincLinc Vanilla's Bard (and Director of Development) Detroit Vanilla Staff

    @ukc Can you point out what needed to be changed?

  • ukcukc New
    edited December 2014

    If you look at the first post, the error that was being thrown was "Error: (1024) Table 'databasenamegoeshere.nodeforum' doesn't exist", and that is as expected - there is no "nodeforum" table in a Drupal 6 database, so the query in the Discussion section can't work.

    Similarly, there is no node_comments table in a Drupal 6 database.

    Also, the category import wasn't working correctly in my case because it was sucking all the taxonomy terms out, rather than just forum names.

    I want to point out that the credit for this need to go to the Plantary Ponderings blog for a post, I think from 2011, discussing migrations from Drupal to Vanilla.

    Did you fix the code formatting on my post, by the way? If so, thanks.

Sign In or Register to comment.