I've upgraded from 6 to 7 and all audio pages has been recreated without audio files.
The audio content type exist under admin/structure/types the same as it was under drupal 6 and the audio files are all in sites/default/files/audio. The entries in files db table are there and correspond to existing nodes => “select fid, uid, filename, filepath from files where fid = node_id;”.
The only problem is that the audio field got somehow lost during the upgrade => admin/structure/types/manage/audio/fields . I have recreated the field but it doesn't bring the files back to its content types. I am crawling through sql tables to figure out how to bring them back.

Comments

ronline’s picture

Status: Active » Needs review

All of my missing content is sitting in content_type_audio table. I think that this are residual data of d6 audio_file module. It looks the table was supposed to be deleted and the content split into new d7 structure @maintainer could you please confirm?

I have moved residual data of one audio content to following tables: field_data_field_audio, file_usage, field_revision_field_audio, file_managed. It does the trick and the file is back to its corresponding audio node.

ronline’s picture

The final fix :
Get all necessary data from content_type_audio and store them in a csv file.
SELECT cnt.vid, cnt.nid, cnt.field_audio_fid, fl.timestamp, fl.fid, fl.uid, fl.filename, fl.filepath, fl.filemime, fl.filesize
INTO OUTFILE '/tmp/content_type_audio.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM content_type_audio cnt, files fl 
WHERE cnt.field_audio_fid = fl.fid AND cnt.nid BETWEEN 36 AND 120 ORDER BY cnt.nid;

Open the csv file in excel or soffice calc and copy corresponding columns in four following files: 
field_data_field_audio.csv, field_revision_field_audio.csv, file_usage.csv, file_managed.csv

Load the data from csv files into database via terminal or phpMyAdmin with following sql commands. 

LOAD DATA LOCAL INFILE '/server/path/field_data_field_audio.csv' INTO TABLE your_db_name.field_data_field_audio fields TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n';

LOAD DATA LOCAL INFILE '/server/path/field_revision_field_audio.csv' INTO TABLE your_db_name.field_revision_field_audio fields TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n';

LOAD DATA LOCAL INFILE '/server/path/file_usage.csv' INTO TABLE your_db_name.file_usage fields TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n';

LOAD DATA LOCAL INFILE '/server/path/file_managed.csv' INTO TABLE your_db_name.file_managed fields TERMINATED BY ',' enclosed by '"' LINES TERMINATED BY '\n';

The files are back now ...

ronline’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jenlampton’s picture

Title: Audio files disappeared after upgrade to d 7. » Audio fields will not upgrade from D6 -> D7 (audiofields do not work with the CCK content migrate module)
Version: 7.x-1.0-beta4 » 7.x-1.0-beta7
Priority: Normal » Major
Status: Closed (fixed) » Active

This issue is definitely not fixed.

I ran into the same problem when upgrading a D6 site with audiofield content to D7. The problem occurs as all CCK fields are migrated from the old D6 CCK-style fields to the D7 core-style fields. CCK provides a module that does the migration for you (Content migrate) but audiofields are apparently un-migratable. CCK throws the following error:

Missing field module: 'filefield'. This field cannot be migrated.

Other file fields like images and PDFs get migrated smoothy, but for some reason the audiofields do not work the same way.

tamerzg’s picture

Have you tried switching your widget type to filefield file upload in D6, and then do the migration. When done you can easily change widget type to audio upload.

jenlampton’s picture

Yes, the solution was to do a manual database query to update both the widget type to 'filefield_widget' and module to filefield, as per #1295286: Migration of filefield fields reports that this requires filefield module, even though its functionality was moved into core!

// SQL: update content_node_field_instance set widget_type = "filefield_widget", widget_module = "filefield" where field_name = "field_podcast";
  db_update('content_node_field_instance')
    ->fields(array('widget_type' => "filefield_widget"))
    ->fields(array('widget_module' => "filefield"))
    ->condition('field_name', 'field_podcast')
    ->execute();
captaingeek’s picture

could i get some help with this im running audio fields and am lost after upgrade.

captaingeek’s picture

I tried putting this in a php file and running from the web server and am getting http 500 error. Lil help?

ws.agency’s picture

Issue summary: View changes
Status: Active » Closed (outdated)