I had defined a simple "website" content type that is a title, a description, and a "weburl". The weburl module came with a version of CCK I had installed on 4.7.x. I've created several hundred of these "website" nodes.
I just did a trial conversion of my site (yes on a test install) using drupal 5.1 with CCK 5.x.1.3.
The "weburl" field is described as being a "Text Field" with URL checking capabilities. It would be nice if that field converted to a Link type on upgrade.
Alternatively I'd like some instructions on how to do the conversion. Obviously I can create a Link field in the 5.1 instance, then write a program to read through the node_field_weburl_data table in the 4.7.x instance and copy that data to an appropriate place in the 5.1 instance...... but I don't know where to copy the data.
Comments
Comment #1
reikiman commentedTo follow up... I read the handbook pages on updating CCK and see the recommendation to upgrade the CK in the 4.7.x instance to the latest version. I think I'm not at the latest. So I'll try that.
Comment #2
reikiman commentedTo follow up again... I updated (the test copy of) my site to drupal 4.7.6 then to CCK 4.7.x-1.3. This made no difference for my weburl fields, they were still ignored and not converted during the upgrade to drupal5.1+CCK5.x-1.3.
Curiously the weburl module was missing from the CCK 4.7.x-1.3 package. I suppose this means that at some time in CCK's history y'all decided to drop that sub-module...? It would be real nice at the moment to have a migration path. As I said, I have hundreds of nodes that use this field type.
I tried reading through the cck.install file so I could get an idea of what the schema is nowadays. But it's more obtuse than you can imagine. It starts out with a nice clean pair of table definitions but there's all these update_xyzzy functions that have changed everything around and it makes it completely hard to figure out what the result is supposed to be. Eek.
Comment #3
reikiman commentedOkay, despite the obtusity of the schema I think I see a manual migration route.
First, the old weburl data is in a table node_field_weburl_data such that node_field_weburl_data.nid is the node ID, and node_field_weburl_data.field_weburl is the URL I'm interested in.
Second, I added a Link field to my website content type. The data for this is in the table content_type_content_website with the field nid having the node ID, and the field field_url_0_url having the URL. I could duplicate the title into field_url_0_title.
It seems like a simple script to convert this.
Comment #4
reikiman commentedHere's my script. I'd be curious for any critiques.
Comment #5
reikiman commentedAh, I just noticed the passwords and stuff I copied into the code. That could have been a major flubbo, except... it's for the MAMP instance on my Mac, not on any production server, and in any case the Mac is behind a firewall. So while I made a mistake, it's not a problem, so don't anybody go raising any alarm bells.
Comment #6
nilard commentedHere is my way of converting weburl fields. First, you should create a link field named 'link', then run the following script:
Comment #7
karens commentedThe D5 version is no longer being supported. Sorry.