hi guys
i have a drupal 6 music site with over 3000 mp3 songs uploaded

i have a custom content type (music) with cck image and upload fields, an mp3 is uploaded with an image and then that node has a flash player which plays the mp3

anyway i have over 3000 nodes and i want to do a clean install of drupal 7 and then bring all my nodes in to the new install, however i need all the themes to keep the same node id and link etc because i have facebook comments for all the nodes and want to keep those comments so cant have the node link change

any ideas on what my best option is for the upgrade?

many thanks in advance

Comments

prezaeis’s picture

no one?

daggett’s picture

It seems not.

Sorry, PRezaei, if by posting this, I have given you false hope.

Neither my post nor Bunzer's have attracted reponses that offer solutions either.

Unless I can find out how to automatically upgrade, I will have no choice but to start to do it manually. I will have to try to manually copy each node (over 2,500 so far) from the old version of drupal (4.* or 5.*?). I will need to work out which table elements will need to be copied for each node and how to adapt them.

Maybe by doing this I will be able to work out how to write a php/mysql script to do this or adapt an existing one.

If I succeed I will be sure to post how I did it, in case it is of help to others.

prezaeis’s picture

the process you suggested is very long-winded and im sure its gonna cause many errors

i just tried using the feed module to import nodes via csv file but it doesnt work properly, the d7 version isnt very stable and keeps giving errors

im so annoyed :(

prezaeis’s picture

ok nearly there

iv got a script below i worked on, which you can use to connect both the drupal 6 and 7 database to the drupal 7 install, and then running this script in a php file will bring over all of the 'music' nodes from the 6 version and put them in the 7 version. note that my node type is music, it has a title, body, ccm image field, taxonomy terms (artist nam) and filefield mp3 upload field.

using the below script i succesfully converted the nodes from version 6 to 7 and title and body is braught over too, but i cant figure out how to bring in the mp3 file field, the cck image field and taxonomies. in my code i tried bringing over the taxonomys too but its not working, any ideas?

define('DRUPAL_ROOT', getcwd());

require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
menu_execute_active_handler();

db_set_active('custom');
            $result = db_query("SELECT uid, nid, title, created, changed, promote, sticky, vid FROM {node} WHERE type = 'music' ORDER BY nid ASC ");
            db_set_active('default');
foreach (

$result as $record) {
                $nid = db_insert('node') // Table name no longer needs {}
                                ->fields(array(
                                    'nid' => $record->nid,
                                    'vid' => $record->vid,
                                    'type' => 'music',    // default type in drupal 7
                                    'language' => 'und',  // default language in drupal 7
                                    'title' => $record->title,
                                    'uid' => $record->uid,  
                                    'status' => '1',
                                    'created' => $record->created,
                                    'changed' => $record->changed,
                                    'comment' => '0',   // 0 for no comment, 2 for allowing commenting
                                    'promote' => '1',
                                    'sticky' => '0',
                                    'tnid' => '0',
                                    'translate' => '0',
                                ))
                                ->execute();
               

$nid = db_insert('node_revision') // Table name no longer needs {}
                                ->fields(array(
                                    'nid' => $record->nid,
                                    'vid' => $record->nid,
                                    'log' => '',
                                    'title' => $record->title,
                                    'uid' => $record->uid,
                                    'status' => '1',
                                    'timestamp' => $record->changed,
                                    'comment' => '0',
                                    'promote' => '1',
                                    'sticky' => '0',
                                ))
                                ->execute();
            }
           

db_set_active('custom');
            $result = db_query("SELECT nid, vid, uid, title, body, teaser FROM {node_revisions} ORDER BY nid ASC");
            $bundle = 'music'; // Default type in Drupal 7
            $entity_type = 'node';   
            db_set_active('default');
foreach (

$result as $record) {
                $nid = db_insert('field_data_body') // Table name no longer needs {}
                                ->fields(array(
                                    'entity_type' => $entity_type,
                                    'bundle' => $bundle,
                                    'deleted' => '0',
                                    'entity_id' => $record->nid,
                                    'revision_id' => $record->nid,
                                    'language' => 'und',
                                    'delta' => '0',
                                    'body_value' => $record->body,
                                    'body_summary' => $record->teaser,
                                    'body_format' => 'full_html'       // filtered_html or full_html
                                ))
                                ->execute();
$nid = db_insert('field_revision_body') // Table name no longer needs {}
                                ->fields(array(
                                    'entity_type' => $entity_type,
                                    'bundle' => $bundle,
                                    'deleted' => '0',
                                    'entity_id' => $record->nid,
                                    'revision_id' => $record->nid,
                                    'language' => 'und',
                                    'delta' => '0',
                                    'body_value' => $record->body,
                                    'body_summary' =>  $record->teaser,
                                    'body_format' => 'full_html'
                                ))
                                ->execute();
            }

          function migrate_post_node() {
    db_set_active('custom');
    $result = db_query("SELECT uid, nid, title, created, changed, promote, sticky, vid FROM {node} WHERE type = 'music' ORDER BY nid ASC ");
    db_set_active('default');
    foreach(

$result as $record){
        /* PICKING TERMS , you can query into your old taxonomy and get tid */
        $term = 8;

        if(empty(

$record)){
            return false;
        }else{
            db_set_active('custom');
            $revisions = db_select('node_revisions')->fields('node_revisions')->condition('nid',$record->nid)->range(0,1)->execute()->fetchObject();
            db_set_active('default');
           

$node = new stdClass();
            $node->title = $record->title;
            $node->type = 'music';
            $node->created = $record->created;
            $node->changed= $record->changed;
            $node->comment = 1;
            $node->status = 1;
            $node->promote = 1;
            $node->sticky = 0;
            $node->uid = $record->uid;
            $node->language = 'und';
            $node->timestamp = $revisions->timestamp;
            $node->revision = 0;
            $node->body['und'][0]['summary'] = $revisions->teaser;
            $node->field_artist_tax['und'][0] = array('tid' => $term);
            $node->body['und'][0]['value'] = $revisions->body;
            $node->body['und'][0]['format'] = 'full_html';
           
$node->date = format_date($node->created, 'custom', 'Y-m-d H:i:s O');
node_submit($node);
            node_save($node);       
        }
    }
    echo

'1';
}
echo

"SUCCES IMPORTED DATA ! ";