Sql-server – Restoring an entire SQL Server database instance

restoresql server

I have a server that we will be completely reformatting then rebuilding. Everything will be rebuilt exactly as it is now – same filenames, same directories, etc.

After SQL Server is installed, I could reattach each of the databases on the server instance one by one from the full backups I've taken.

However, will the following also work to make the job faster?

  1. Shut down the SQL Server instance
  2. Copy all databases, including system databases, to another disk
  3. Reformat the server and reinstall SQL Server
  4. Shut down the SQL Server instance
  5. Copy all files back to their original locations, overwriting existing files (would I also need the hidden Resource database?)
  6. Start the SQL Server instance again

As long as everything is in the correct location, shouldn't the master database fire right up without issue, and the full server will be restored to the same way it looked pre-reformat? I'm just wondering if this could save me some time.

Best Answer

You're better off detaching the databases from the server, then reattaching them after installation. Detach and Attach are pretty fast operations, and they're quite clean to execute from SQL Server Management Studio.

Plus, you only need to do that to the databases you care about. Let the System DB take care of itself. :)