How to move all events on an "On my iPhone" calendar to an iCloud-synced calendar?
I think the easiest way is to use a third-party iOS/iPadOS file managing software such as iMazing. This would allow you to access your iPhone calendars and export them into formats such as .ics or .csv file. You can find more info here.