private void upgradeTable(TaskMonitor monitor) throws IOException, CancelledException {

		AddressMap oldAddressMap = addrMap.getOldAddressMap();

		monitor.setMessage("Upgrading '" + name + "' Properties...");
		monitor.initialize(propertyTable.getRecordCount() * 2);
		int count = 0;

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

			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();
				if (tempTable == null) {
					// Create table on first entry upgrade
					tempTable = tmpDb.createTable(getTableName(), schema);
				}
				Address addr = oldAddressMap.decodeAddress(rec.getKey());
				rec.setKey(addrMap.getKey(addr, true));
				tempTable.putRecord(rec);
				monitor.setProgress(++count);
			}

			if (tempTable == null) {
				return;
			}

			// Remove old table
			dbHandle.deleteTable(getTableName());

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

			// 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);
			}
		}
		finally {
			tmpDb.close();
		}
	}
Check if a table upgrade should be performed or a version error thrown.
@param openMode the mode that the program was openned in or null if instantiated during
cache invalidate.  Used to detect versioning error only.
@param monitor task monitor
@throws VersionException if the database version is not the expected version.
@throws CancelledException if the user cancels the upgrade operation.
@throws IOException if an IO error occurs
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/properties/PropertyMapDB.java