static LabelHistoryAdapter upgrade(DBHandle dbHandle, AddressMap addrMap,
			LabelHistoryAdapter oldAdapter, TaskMonitor monitor)
			throws VersionException, IOException, CancelledException {

		AddressMap oldAddrMap = addrMap.getOldAddressMap();

		DBHandle tmpHandle = new DBHandle();
		try {
			tmpHandle.startTransaction();

			monitor.setMessage("Upgrading Label History...");
			monitor.initialize(oldAdapter.getRecordCount() * 2);
			int count = 0;

			LabelHistoryAdapterV0 tmpAdapter = new LabelHistoryAdapterV0(tmpHandle, true);
			RecordIterator iter = oldAdapter.getAllRecords();
			while (iter.hasNext()) {
				if (monitor.isCancelled()) {
					throw new CancelledException();
				}
				DBRecord rec = iter.next();
				Address addr = oldAddrMap.decodeAddress(rec.getLongValue(HISTORY_ADDR_COL));
				rec.setLongValue(HISTORY_ADDR_COL, addrMap.getKey(addr, true));
				tmpAdapter.table.putRecord(rec);
				monitor.setProgress(++count);
			}

			dbHandle.deleteTable(LABEL_HISTORY_TABLE_NAME);
			LabelHistoryAdapterV0 newAdapter = new LabelHistoryAdapterV0(dbHandle, true);

			iter = tmpAdapter.getAllRecords();
			while (iter.hasNext()) {
				if (monitor.isCancelled()) {
					throw new CancelledException();
				}
				DBRecord rec = iter.next();
				newAdapter.table.putRecord(rec);
				monitor.setProgress(++count);
			}
			return newAdapter;
		}
		finally {
			tmpHandle.close();
		}
	}
Constructs a new LabelHistoryAdapterV0
@param handle the database handle.
@param create if true, create the tables.
@throws VersionException if the database table version does not match this adapter's version.
@throws IOException if a database io error occurs.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/LabelHistoryAdapterV0.java