private void comitSaveChangeDataFile() throws IOException {

		// Identify temporary change data file (see getSaveChangeDataFile)
		if (saveChangeFile == null || !saveChangeFile.getFile().exists()) {
			throw new FileNotFoundException("Saved change data file not found");
		}
		File changeFile = saveChangeFile.getFile();

		// Determine if we are replacing an existing change data file
		File cfile = bfMgr.getChangeDataFile(version);
		File bakFile = null;
		if (cfile.exists()) {
			// Temporarily rename old change data file
			bakFile = new File(cfile.getParentFile(), cfile.getName() + ".bak");
			if (!cfile.renameTo(bakFile)) {
				throw new IOException("Failed to update change data");
			}
		}

		// Move new change data file into place
		if (changeFile.renameTo(cfile)) {
			// Remove old change data file
			if (bakFile != null) {
				bakFile.delete();
			}
		}
		else {
			// Put old change data file back in place
			if (bakFile != null) {
				bakFile.renameTo(cfile);
			}
			throw new IOException("Failed to update change data - file may be in use");
		}
	}
Output old data for a specified buffer if required for version file.
@param index buffer index
@throws IOException
Ghidra/Framework/DB/src/main/java/db/buffers/LocalManagedBufferFile.java