Create a mapping table to record the drupal nid to the unique id found on the old database. The purpose is to have a way of tracking the work done, and to have a way of double checking.
Also, it is used to know what data has already been inserted, and what new data has not yet been inserted.
* the minimum columns in a mapping table would be
** id : just the usual unique id for a table
** nid: node nid created in drupal
** label_id: unique id on the old database
** other columns can be created as needed, for quick reference and checking.