So the next thing to do is to develop an automated process for replacing the images in those nodes where Image Assist had been used to insert them in D6. I think the process is:
- Find the nodes that have images inserted by Image Assist in D6.
To find the nodes with images inserted using ImageAssiste use:
SELECT * FROM `node_revisions` WHERE `body` LIKE '[img_assist%'
LIKEoperator looks for a pattern in the field. In this instance the string starting with
%is a wildcard so that all are found. A test of the query returns 715 rows, which is rising as we add more posts to the online live site.
- Determine the Node ID for the Image Node the image is located in. The Node ID is the next part of the Image Assist string in the Body of the Poem (or other) node.
- Determine the file path of the image file. The Image table has three columns, the first two are the Node ID (i.e. the Node that contains the image not the node that the image is embedded in) and the File ID. So using
SELECT * FROM `image` WHERE `nid`=1389returns:
nid fid image_size
1389 2608 preview
1389 2595 _original
1389 2607 thumbnail
And looking in the Files table using
SELECT * FROM `files` WHERE `fid`=2595returns the line with the filepath filed containing the path to the original image file on disk.
- Insert the image file into the Poem node so that it floats to the right with padding like Image Assist used to do
There is then the issue that the text layout of the poems themselves has been lost too!