<p>What is the most efficient way to go through and update every single node in a drupal site, to, for instance mechanically add tags? Drupal 6 has a shiny new batch API, but what to do in Drupal 5?</p>

<p>I started writing a script that keeps a pointer and then goes around all nodes on a cron, loads them and then saves them, but I wonder what else could be done.</p>

hmm i'm not familiar with drupal 5's database structure, but if it's similar enough to drupal 6, you could just modify this all pretty easily by just working off the
```
term_node
```
table. it's a mapper of node id's to term id's:
```
```
term_node
- nid
- vid
- tid
```
```
nid is the node id of course, vid is the revision id, if you use revisions, and tid is the term id. terms are all stored in
```
term_data
```
```
```
term_data
- tid
- name
```
```
are the more interesting columns. so if you already have existing terms, you can create a quick map of existing tid's, then add to whatever nodes you want in term_node. anyhow, being careless in this regard could possibly cause weird data issues, so i wouldn't suggest this approach unless you feel pretty comfortable with the raw database.