I have a series of polygons in a geopackage file of QGIS polygons. Is it possible to transfer the contents of this file to another geopackage that has multipolygons as vector data type? I need to fix this error because I need to merge multiple polygons and I can't do it using the simple source "polygon" geopackage but I need a "multipolygon" geopackage.
user30184 posted a programatic response but you will need to know how to use GDAL libraries.
The assumption is that your existing geopackage has geometry type of 'Polygon'. This geometry type does not allow multi-part polygons. A 'Merge selected features' action on a geopackage wit that geometry type will cause QGIS to error when you attempt to save those changes.
eg: could not commit changes to layer AAABBBCCC Errors: ERROR: 1 feature(s) not added - geometry type is not compatible with the current layer.
When creating a new geopackage, you should have created multipolygon geometry type. The way to fix this, is to use the GDAL libary as mentioned by user30184. The only downside is that this method and all other methods are going to create a new file. It would be neater if you could apply the geometry type change to te existing file and just overwrite the existing file, but retain any existing data. (like what happens in some database technologies).