title: Restoring a SQL Server 2012 database in high availability
body: <p>I have a database which is in always-on high availability mode synchronized with another database on a different instance. How can I restore from a <code>.bak</code> file into the primary database using T-SQL?</p>
  
  <p>I'm new to high availability and I've been advised that I need to take the database out of high availability before I can do a restore and then put it back in high availability again but I'm not sure.</p>
  
  <p>I'm hoping I can just restore straight into the primary while the AlwaysOn is still enabled and it will auto sync with the secondary.</p>