Tesla’s batteries are modular, and you can easily repurpose them. Yes, you’ll need a new charge controller, but that’s it.
More often than not, you’d want your own charge controller anyway to for example run at a lower voltage (different series). At least for the Model S/X modules. The 3/Y modules are a little bit trickier to re-use because they are higher-voltage and not as modular.