Moving databases and logs to another location

As your environment grows or changes over time, it may be necessary to move one or more databases and their log streams to another location. This is one of those tasks that's required to be done from the Exchange Management Shell. As an advantage, the shell gives you some more flexibility. In this recipe, you will learn how to move the database and logfiles to another location.

How to do it...

To move the database file and log stream for the DB1 database to a new location, use the following command syntax:

Move-DatabasePath -Identity DB1 `
-EdbFilePath E:\Databases\DB1\DB1.edb `
-LogFolderPath E:\Databases\DB1 `
-Confirm:$false `
-Force

After executing the preceding command, the DB1 database and logfiles ...

Get Microsoft Exchange Server 2013 PowerShell Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.