On mobile you can do this via backups and use https://github.com/xeals/signal-back
On desktop you can copy the appdata folder over to the new device. (warning: this is not officially supported)
Note that you must close the app on desktop from the host computer before copying the files over, otherwise the forward secrecy stuff breaks and you'll have to reset the sessions on the migrated computer.