ive seen nothing but problems with attempts to do so, with the domain being such a core part of addressing in the fediverse.
even if you can get the old install database to reflect the new domain, all remote systems will not just magically know your domain changed.. they will treat your old system as a 'new' instance.
youre better off just installing against the new domain.