To migrate from Audio module to AudioField module in Drupal 6 please try this module:
http://drupal.org/sandbox/jenlampton/1761334

If you have added any additional fields to the Audio node type provided by the audio module, you will need to modify the content type provided by this feature, and make sure all the fields are the same on your new Podcast node type before running the migration.

Alternatively, you can also try use this hackey script:

// ***** CONFIGURATION *******
// The audiofield CCK that you have already created as per Prerequisites.
$field_name = 'field_audio';
// The content type that you have already created as per Prerequisites.
$type_name = 'audio2';

//Database settings
$db_username="root";
$db_password="";
$source_db_name="main_site";
// ***** END CONFIGURATION *******

$db_source_link=mysql_connect("localhost",$db_username,$db_password) or die("Error connecting to database");

mysql_select_db($source_db_name,$db_source_link) or die("Error connecting to drupal database");

// Populate the audiofield table for every audio node.
$table = 'content_type_'. $type_name;
$fid = $field_name. '_fid';
$res=mysql_query("SELECT * FROM audio",$db_source_link);

$counter=0;
while($audio=mysql_fetch_array($res,MYSQL_ASSOC)){   
	
	mysql_query( "INSERT INTO $table (vid,nid,$fid) VALUES(".$audio['vid'].",".$audio['nid'].",".$audio['fid'].")",$db_source_link);
	$counter++;
}
echo "- $counter audio nodes migrated.<br />\n";

// Change the content type from 'audio' to the configured type.
mysql_query("UPDATE node SET type = '$type_name' WHERE type = 'audio'",$db_source_link);

// Clear CCK cache.
mysql_query("DELETE FROM cache_content",$db_source_link);

Comments

Sakrecoer’s picture

I love you and i Love you even more!

Right on time my beloved php gurus! :)

Now, despite this, my n00biness implies the following question:
where do I enter this script?

open your mind open the source
express yourself, share your tools

Sakrecoer’s picture

Could this be my sollution?:

Copy paste the code.
Adapt the information to my server (dbname, user pass etc...)
save it to a php file in the webfile root
run it from my webrowser?

greatfull for an answer :)

open your mind open the source
express yourself, share your tools

jenlampton’s picture

It looks horribly dangerous for someone who doesn't know exactly what they are doing.

Give the module a shot (on a test site) and see if that does the trick for you.

captcha’s picture

Yes, that works for me.
But I had to echo the insert statements and paste the sql code directly through phpmyadmin into the content_type_ table as the data wasn't getting inserted otherwise.

$sql_str = "INSERT INTO $table (vid,nid,".$fid.") VALUES(".$audio['vid'].",".$audio['nid'].",".$audio['fid'].");";
echo $sql_str."<br>";
$rs = mysql_query( $sql_str,$db_source_link);