Is it possible to preserve the Device ID while doing a factory reset? Does factory reset restore the Device ID or create a new one?

I have a rooted device that I would like to restore but want to keep the ID so that I won't have the issue of creating new accounts on apps that were in use.

Is it possible to preserve the Device ID while doing a factory reset?
It is possible to restore the Device ID with Titanium Backup (root required). If you have this app installed before you wipe, you can make backups of your apps and data, as well as the Device ID.

When you factory reset your device or install a new Rom, you get a new Device ID. Install Titanium Backup and make sure it has access to its backups (usually the external SD card; internal memory will usually get wiped on a factory reset).

It will automatically detect that the Device ID has changed and ask if you want to restore it.

There may be other apps that can do this. The main requirement is that you save the previous Device ID before wiping. If you don't do that, you can't reset the new Device ID to the old one.