Adding Taxonomy terms programmatically with specific tid? I would like to add a term to a vocabulary specifing the tid, already tried with Taxonomy CSV import/export and Taxonomy import/export via XML modules but both create terms with a new tid.

I even tried programmatically with taxonomy_term_save() but if i set the tid it just looks for a term with that ID.

I need to do this because then i'll import a lot of nodes, and all of them already have a relation with a term.

Any other way to do this?
tid will be assigned to the terms automatically by drupal. My suggestion is first create the terms then you can use taxonomy_get_term_by_name function to find the term and then map it to the respective node while importing.