public synchronized PackedDatabase saveAs(String itemName, File dir, String packedFileName,
			Long newDatabaseId, TaskMonitor monitor)
			throws IOException, DuplicateFileException, CancelledException {

		if (isTransactionActive())
			throw new IllegalStateException("Can't saveAs during transaction");
		ResourceFile packedDbFile = new ResourceFile(new File(dir, packedFileName));
		pdb = new PackedDatabase(this, packedDbFile, itemName, newDatabaseId, monitor);

		return pdb;
	}
Save open database to a new packed database with a specified newDatabaseId.
If another PackedDatabase was associated with this handle prior to this invocation
it should be disposed to that the underlying database resources can be cleaned-up.
NOTE: This method is intended for use in transforming one database to
match another existing database.
@param itemName
@param dir
@param packedFileName
@param newDatabaseId database ID to be forced for new database or null to generate 
new database ID
@param monitor
@return new packed Database object now associated with this handle.
@throws CancelledException if task monitor cancelled operation.
@throws IOException
@throws DuplicateFileException
Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/store/db/PackedDBHandle.java