Migrating Matrix & Ngen file fields to EE2 Matrix and native file field
I recently upgraded my personal family site with MSM from ExpressionEngine 1.6.9 to 2.1.3 and as most EE devs know this is a major upgrade with a lot of potential for incompatibilities due to the complete restructuring that went into the 2.x branch of ExpressionEngine.
Long time no blog. I'm back and planning on writing more frequently here.
I recently upgraded my personal family site with MSM from ExpressionEngine 1.6.9 to 2.1.3 and as most EE devs know this is a major upgrade with a lot of potential for incompatibilities due to the complete restructuring that went into the 2.x branch of ExpressionEngine. To ensure everything went very smooth I copied my site to a development server and did the upgrade there. I was also very careful to follow the upgrade instructions.
Even so there were a couple of SNAFUs mostly due to having missed on finding an EE2 compatible version of an addon. The biggest problem was moving my photo galleries to EE2 as they were run using Matrix in combination with nGen file field which has not been ported to EE2 and it doesn't look like it will happen anytime soon.
A quick search of the EE forums found this thread and got a lot of help from this one.
I used sql query listed in the thread
UPDATE exp_matrix_data
SET col_id_1 = CONCAT('http://caffeinecreations.ca/uploads/screenshots/', col_id_1)
WHERE col_id_1 != ''
AND col_id_1 NOT LIKE '{filedir_%'
But I found that it didn't work exactly correctly. I had taken not of my file directory settings in EE1.6.x before upgrading and inexplicably the file directories changed from filedir_2 to filedir_6 Once I figured that out, everything worked fine.
One of the keys to success was that all ngen file fields had to be converted to text fields before the upgrade as did any other non-standard EE field. Once the upgrade was completed, I then enabled all addons and went into the field settings and reset all fields to the correct field. Once that was done the upgrade was completed. Not getting that step done resulted in having to revert to EE1.6.x and redo the upgrade several times before I finally got everything nailed down.