When I am converting my geopackage file in shapefile, the unique ID field is not exported. I could duplicate it before exportation, but I wanted to know if it could be done in one step, in order not to modify my geopackage. I am using ogr2ogr to make the conversion.
This should work
ogr2ogr -f "ESRI Shapefile" -dialect SQLite -sql "select NewID as source_id,* from your_layer" exported_layer.shp your_geopackage.gpkg
It may not be necessary to rename NewID, or it may work if you rename it with an original name
select NewID as NewID.... I had a test with GeoPackage using field "fid" as FID and then I had to rename it.