When you sign out of one ID you will be asked if you wish to keep data that are stored on the device and merge it with the iCloud data for the other account when signing in (but apparently you don't use iCloud). Things that are actually on the phone will be retained as long as you make sure you select the options to do so.
Also make sure you sign our of Find My with the first ID if you want the phone to now "belong" to the other ID.
What you won't be able to do is redownload or update any apps, movies, music or use any subscriptions that were purchased with the pother ID unless you set up Family Sharing with yourself. Apps already on the phone will likely still work but won't update or redownload.
Oh, by the way, this is technically what you are supposed to do when reassigning an ID on a device, but you will see it tells you to erase the device. What to do before you sell, give away, or trade in your iPhone or iPad - Apple Support