First connect new data source in tableau and then replace existing one. Now all calc will be there in new datasource.
First, you might be better served if you use Edit Data Source and point the original connection to the new DB. As long as the fields are all exactly the same this should work, and you won't have to recreate the calcs. If for some reason this doesn't work, then when using the Replace copy all of your calcs from the original connection to the new connection before you do the replace. There is one wrinkle when doing this, and that is, if you have calcs that reference other calcs you'll need to make sure to copy the 'base' calc over before you copy the referencing calc.
This can take a little time, but probably not as much time as recreating them from scratch.