<p>You want to look at the <code>craft_content</code> table. There you should find the <code>title</code> column and the <code>field_altTag</code> column. You could set the <code>title</code> to the <code>field_altTag</code> value where that value is not empty.</p>

<p>Back up the database first...</p>

CC BY-SA 3.0
2016-09-02T19:36:35.783Z
2016-09-02T19:36:35.783Z
Marion Newlevant
<p>In Craft, is it possible to map one field containing string value to another?</p>

<p>I have a bunch of image assets that has a title field and <code>altTag</code> fields. I've entered data into the alt tag field, but now I would like to copy that data for each asset into the <code>title</code> field for that same asset.</p>

<p>Doing this manually for each asset would take forever, but it sounds like something that could be done with mysql queries.</p>

<p>I poked around the database to see where the <code>title</code> fields or the <code>altTag</code> fields are stored. The <code>altTag</code> field is in the <code>craft_fields</code> table, and I can see all my assets in the <code>craft_assetfiles</code> table. But <code>title</code> is not one of the columns in this table, I do see the <code>filename</code> column. But I think my knowledge of the structure of craft tables are lacking to find where the values for the <code>altTag</code> fields are stored or how to copy the value of each alt tag into the corresponding title field for the asset.</p>

<assets><relations><database><mysql>
Map one asset attribute field to another using MySQL
# Map one asset attribute field to another using MySQL

(Asked by: username_0 on 2016-09-02)

In Craft, is it possible to map one field containing string value to another?

I have a bunch of image assets that has a title field and `altTag` fields. I've entered data into the alt tag field, but now I would like to copy that data for each asset into the `title` field for that same asset.

Doing this manually for each asset would take forever, but it sounds like something that could be done with mysql queries.

I poked around the database to see where the `title` fields or the `altTag` fields are stored. The `altTag` field is in the `craft_fields` table, and I can see all my assets in the `craft_assetfiles` table. But `title` is not one of the columns in this table, I do see the `filename` column. But I think my knowledge of the structure of craft tables are lacking to find where the values for the `altTag` fields are stored or how to copy the value of each alt tag into the corresponding title field for the asset.

**Tags:** assets, relations, database, mysql


---

## 1 answers

### Answer by username_1 on 2016-09-02. Score: 1

You want to look at the `craft_content` table. There you should find the `title` column and the `field_altTag` column. You could set the `title` to the `field_altTag` value where that value is not empty.

Back up the database first...


---

