change SQL instance

How to move AMS or its SQL databases to another machine.