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
Comment #1
ronline CreditAttribution: ronline commentedAll 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.
Comment #2
ronline CreditAttribution: ronline commentedThe 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 ...
Comment #3
ronline CreditAttribution: ronline commentedComment #5
jenlamptonThis 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:
Other file fields like images and PDFs get migrated smoothy, but for some reason the audiofields do not work the same way.
Comment #6
tamerzg CreditAttribution: tamerzg commentedHave 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.
Comment #7
jenlamptonYes, 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!
Comment #8
captaingeek CreditAttribution: captaingeek commentedcould i get some help with this im running audio fields and am lost after upgrade.
Comment #9
captaingeek CreditAttribution: captaingeek commentedI tried putting this in a php file and running from the web server and am getting http 500 error. Lil help?
Comment #11
ws.agency CreditAttribution: ws.agency at Websolutions Agency commented