private boolean upgradeTable(T tokenInstance, TaskMonitor monitor)
			throws CancelledException, IOException {

		boolean allRecordsUpgraded = true;
		AddressMap oldAddressMap = addrMap.getOldAddressMap();

		monitor.initialize(propertyTable.getRecordCount() * 2);
		int count = 0;

		// Remove map table if upgrade not supported
		if (!tokenInstance.isUpgradeable(schema.getVersion())) {
			dbHandle.deleteTable(getTableName());
			propertyTable = null;
			schema = null;
			return false;
		}

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

			Schema newSchema = null;
			Table tempTable = null;

			// Upgrade map entries into temporary database
			RecordIterator iter = propertyTable.iterator();
			while (iter.hasNext()) {
				if (monitor.isCancelled()) {
					throw new CancelledException();
				}
				DBRecord rec = iter.next();
				ObjectStorageAdapterDB oldObjStorage = new ObjectStorageAdapterDB(rec);
				ObjectStorageAdapterDB newObjStorage = new ObjectStorageAdapterDB();
				if (!tokenInstance.upgrade(oldObjStorage, schema.getVersion(), newObjStorage)) {
					allRecordsUpgraded = false;
					continue; // skip
				}
				if (newSchema == null) {
					// Create table on first entry upgrade
					newSchema = newObjStorage.getSchema(saveableObjectVersion);
					tempTable = tmpDb.createTable(getTableName(), newSchema);
				}
				Address addr = oldAddressMap.decodeAddress(rec.getKey());
				DBRecord newRecord = newSchema.createRecord(addrMap.getKey(addr, true));
				newObjStorage.save(newRecord);
				if (tempTable != null) {
					tempTable.putRecord(newRecord);
				}
				monitor.setProgress(++count);
			}

			// Remove old table
			dbHandle.deleteTable(getTableName());
			propertyTable = null;
			schema = null;

			if (tempTable == null) {
				return false;
			}

			// Create new map table
			propertyTable = dbHandle.createTable(getTableName(), newSchema);
			schema = newSchema;

			// Copy upgraded records
			iter = tempTable.iterator();
			while (iter.hasNext()) {
				if (monitor.isCancelled()) {
					throw new CancelledException();
				}
				DBRecord rec = iter.next();
				propertyTable.putRecord(rec);
				monitor.setProgress(++count);
			}

		}
		catch (IOException e) {
			errHandler.dbError(e);
		}
		finally {
			tmpDb.close();
		}
		return allRecordsUpgraded;
	}
Attempt to upgrade the map table records to the current schema.
If unable to upgrade any of the map records, the table is removed.
@param tokenInstance token saveable instance
@param monitor task monitor
@return true if all records were successfully upgrade.  A false
value indicates that one or more entries were dropped.
@throws CancelledException if task is cancelled
@throws IOException if IO error occurs
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/properties/ObjectPropertyMapDB.java