This was a big help to me too. I had searched far and wide to find a way to convert nGen file fields to EE2 file fields. Nothing helped until I found this. Thank you!!!
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
July 30, 2010 12:57pm
Subscribe [24]#16 / Sep 03, 2010 11:02am
This was a big help to me too. I had searched far and wide to find a way to convert nGen file fields to EE2 file fields. Nothing helped until I found this. Thank you!!!
#17 / Sep 06, 2010 2:12am
I’m a little surprised (miffed) that this got moved out of Tech Support and into CodeShare. Clearly a lot of people are having this problem, and given that fieldtypes are now an integral part of EE2, why is there no tech support in terms of helping people upgrade from EE1x?
Okay, fieldtypes like nGen File Field were a third party issue in EE1.6, but now they are INTEGRATED into EE2—there’s an actual File field that goes with EE’s new File Manager—I think the least Ellis Labs can do is provide some sort of clear upgrade guidance for people migrating from a 1.6 Matrix/nGen setup to EE2.
I had a similar problem with updating my own site from 1.6.9 to 2.1, where a bunch of portfolio entries were set up in nGen File field, inside Brandon Kelly’s Matrix extension. I got precious little help from Brandon, who seems to imply that the EE2 installer is “supposed” to migrate/convert fields for you.
What gives?
#18 / Nov 26, 2010 8:03pm
I need some help please. I’ve been struggling and can’t figure this out. Where/how do I find col_id_XX and filedir_YY?
Thanks
Figured it out thanks
#19 / Jan 02, 2011 9:27pm
Rob Sanchez, you’re my hero.
I had been putting off updating an image heavy site to EE2 for a while now, as I discovered this issue when I updated my portfolio site. There weren’t as many images, so it wasn’t a big deal, but this would have taken days.
I had to updated a file field inside of a Matrix, and modified the query like so:
UPDATE exp_matrix_data SET col_id_XX = CONCAT('{filedir_YY}', col_id_XX) WHERE col_id_XX != '' AND col_id_XX NOT LIKE '{filedir_%'The col_id_XX is the Matrix cell you want to update.
do I do this sql query before or after upgrading to 2.1.x also the code seems to have been cut off above what this the ending of it?
#20 / Jan 02, 2011 9:33pm
I guess you could do it before or after. I did it after the upgrade and it worked great.
There isn’t anything missing from the snippet. You just need to replace the XX and YY with the appropriate numbers.
#21 / Jan 02, 2011 9:39pm
Alex so all I need to do is add a closing bracket?
)also where does one find the column_id?
on second look it seems like there is a missing curly brace }
#22 / Jan 02, 2011 9:52pm
No, there is nothing missing from the snippet. Use it as-is. The % character is a wild-card character.
The col_id_XX is the Matrix cell you want to update.
You can find the column_id by using PHPMyAdmin, SequelPro, or Navicat (or similar). Browse the exp_matrix_data table.
#23 / Jan 02, 2011 11:33pm
Alex,
really appreciate your help here. I ran the following query
UPDATE exp_matrix_data
SET col_id_1 = CONCAT('https://ellislab.com/asset/images/ent-partner-logo/', col_id_1)
WHERE col_id_1 != ''
AND col_id_1 NOT LIKE '{filedir_%'now on the front end of the site I’m getting this error
Error
Unable to load requested field type file: ft.ftype_id_2.php.
Confirm the fieldtype file is located in the expressionengine/third_party/ directory
and in the backend I’m getting two php errors when checking the custom fields page for the field in question
A PHP Error was encountered
Severity: Notice
Message: Undefined index: ngen_file_field
Filename: matrix/ft.matrix.php
Line Number: 764
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/dev2crea/public_html/mr_system/codeigniter/system/core/Exceptions.php:170)
Filename: core/Common.php
Line Number: 405
I’m not sure why it’s asking for ngen now - I’ve uploaded matrix and installed it and ran the query but it looks like I’ve missed something.
#24 / Jan 02, 2011 11:42pm
Do you have any other ngen file fields you might have missed?
#25 / Jan 02, 2011 11:49pm
On another site (MSM) but I’m not viewing that site.
#26 / Jan 03, 2011 9:32am
Sounds like you need to change the Matrix cell type for that column to a File field. Or go into your exp_matrix_cols table, find the col in question and change its col_type from ftype_id_2 to file.
#27 / Jan 05, 2011 7:09am
Rob,
thanks for your suggestion and my apologies for a late reply. I checked in phpmyadmin and the cell type is already file. Still getting this error and not sure how to proceed.
#28 / Jan 05, 2011 9:54am
As far as I know there’s only three locations in the DB that store fieldtype names, exp_matrix_cols->col_type and exp_fieldtypes->name and exp_channel_fields->field_type.
I’d check all those three locations for the offender. Otherwise, I’d check with B. Kelly and see if he has an answer.
#29 / Feb 16, 2011 11:36am
UPDATE: This is only applicable on EE 2.1.3, 2.1.4, and 2.1.5. Use the File Manager’s built in sync if you’re on EE 2.2 or above.
Just a followup here, if you’ve used this method, you may have noticed that you don’t have any thumbnails. This is because in EE2, thumbnail files are generated upon upload. Since these files already exist and aren’t going through the upload process, their thumbnails have not been created. I wrote a simple script here to generate thumbnail files for a directory. You should be able to use this in a PHP enabled template.
<?php
/* WARNING */
//if you have a large number of files here
//you may run into PHP max_execution_time or memory_limit errors
//change this to the full server path to your upload directory WITH trailing slash
$server_path = '/Applications/MAMP/htdocs/ee2/images/uploads/';
$this->EE->load->helper('file');
$this->EE->load->library('filemanager');
foreach (get_filenames($server_path) as $name)
{
if ( ! file_exists($server_path.'_thumbs/thumb_'.$name))
{
$this->EE->filemanager->create_thumb(
array('server_path' => $server_path),
array('name' => $name)
);
}
}
echo 'FINISHED THUMB CREATION';
?>#30 / Mar 21, 2011 11:22am
Hey Rob,
PHP script works like a charm. THX