WEBVTT

00:03.200 --> 00:11.420
As your environment grows or changes over time it may be necessary to move one or more databases and

00:11.420 --> 00:15.110
there are log streams to another location.

00:15.110 --> 00:21.030
This is one of those tasks that require to be done from the Exchange management shell.

00:21.050 --> 00:25.490
The advantage is the shell gives you some more flexibility.

00:25.700 --> 00:33.620
And this video you'll learn how to move databases and log files to another location so to move the database

00:33.650 --> 00:39.810
file and log 3M for the debate time database to your location.

00:39.910 --> 00:42.440
Use the following command syntax.

00:42.440 --> 00:43.630
Move database.

00:43.640 --> 00:47.630
Path identity D-B term UDP path.

00:47.780 --> 00:57.690
In my case it's C-Drive databases DBI 10 database D-B tell got it to be and lock folder path is C-Drive

00:57.690 --> 00:58.840
for databases.

00:58.840 --> 01:00.420
Debit logs.

01:00.480 --> 01:10.300
We are also use them confirm parameter which is set to false and for parameter after Ronnell the code.

01:10.310 --> 01:16.370
The turned database and block files will be moved to seed databases.

01:16.370 --> 01:22.520
The Bytown database directory without Braunton you for confirmation.

01:22.520 --> 01:29.540
In this example you can see that we are moving both the database file and the transaction logs to the

01:29.540 --> 01:30.780
same directory.

01:30.920 --> 01:39.490
You can use different directories or even separate disks spindles as the location for the database and

01:39.490 --> 01:42.090
lock folder paths if needed.

01:42.230 --> 01:47.970
Actually it's the best practice to do so to remove the confirmation Broome's.

01:47.970 --> 01:56.150
We need to set the Confirm parameter to false and also use the for switch parameter.

01:56.300 --> 02:02.570
This may be an important detail if you are running this command left from the automated script.

02:02.750 --> 02:10.940
If not to use the command Let will not make any changes until an operator confirms it in the shell.

02:10.940 --> 02:18.410
Obviously in order to move the database file or locks the database will need to be taken off line for

02:18.410 --> 02:20.470
the duration of them.

02:20.660 --> 02:27.620
The move database first command Let will automatically dismount the database and remount it while the

02:27.830 --> 02:29.860
move process is completed.

02:29.990 --> 02:37.130
If the database is already dismounted at the time that you initiate the move the database will not be

02:37.220 --> 02:43.040
automatically mounted upon completion and two will need to mount manually.

02:43.130 --> 02:45.720
You know the MT database command left.

02:45.800 --> 02:54.470
Obviously any user with a mailbox in a dismounted database will be able to connect to their mailbox.

02:54.560 --> 03:03.600
If you need to move a database ensure that this can be done during a time that will not impact and users.

03:03.710 --> 03:12.110
Keep in mind that databases that are replicated within a database availability group or DEC group can

03:12.110 --> 03:20.750
not be moved each database copy in a deck needs to use the same local bass for the database and blocks

03:21.050 --> 03:26.680
so you can change lives after copius have already been created.

03:26.690 --> 03:34.100
If you need to change the path for a replicated database you will need to remove all database copius

03:34.100 --> 03:36.140
and perform the move.

03:36.140 --> 03:44.360
Once this process has been completed you can create new database copius that will use the new path no

03:44.540 --> 03:51.270
before changing it in be a path or look folder path locations for a database.

03:51.290 --> 03:56.150
You may want to change an existing configuration to do so.

03:56.150 --> 04:02.530
Use the get mailbox database come on glad to check the existing configuration.

04:02.580 --> 04:08.450
Actually let's switch over to exchange management shell and run this command.

04:08.450 --> 04:12.450
Here you can see that we are pipe in the mailbox database.

04:12.450 --> 04:13.560
Come on let.

04:13.680 --> 04:16.820
To format list using the file.

04:16.820 --> 04:25.790
LS and selecting the name of the B file path and lock field or path properties which will display the

04:25.790 --> 04:30.740
relevant information for every database in the organization.

04:30.740 --> 04:37.910
You can retrieve this information for a single database by specifying the name of the database using

04:37.910 --> 04:44.040
the identity parameter or just type the name of the database.

04:44.060 --> 04:47.190
So let's add after get mailbag.

04:47.210 --> 04:53.420
Box databases command layout the name of the database we need.

04:53.450 --> 05:02.270
In my case it's DBI 20 and we can easily check the existing configuration for the database we want to

05:02.270 --> 05:02.740
move.

05:02.950 --> 05:12.080
Now let's switch over back to power shall I see and perform manual movement of database debate granted

05:12.380 --> 05:20.240
in certain situations you might prefer to manually copy or move the database and lock files instead

05:20.240 --> 05:26.800
of allowing them move data base Bascombe out loud to move the data for you.

05:26.840 --> 05:30.200
In this case you can use the following process.

05:30.200 --> 05:36.560
Let's say that you need to move the DP Trantor database to the new location.

05:36.560 --> 05:40.650
In my case it's just a lab example.

05:40.670 --> 05:48.670
I will move the database 20 from the allocation DBI Atlanta to D-B the scorpion.

05:48.830 --> 05:50.530
Debbie Trantor desktop.

05:50.690 --> 05:56.000
So to do this manually The first thing you will want to do is dismount.

05:56.000 --> 06:02.220
The database will have to run the following command let this mount database database DBI trained to

06:02.490 --> 06:04.490
confirm false.

06:04.510 --> 06:05.190
Next.

06:05.300 --> 06:11.180
Use whatever method you prefer to copy the database to the new location.

06:11.180 --> 06:17.680
I'll go to databases folder and just make a copy of it.

06:17.680 --> 06:26.270
Granted folder was the default name it will be Debrett ranted Sgarbi after the database has been copied.

06:26.270 --> 06:34.640
You then move database path command that does the configuration information and in exchange the president

06:34.640 --> 06:42.100
command to use this configuration only switch parameter when running the move database path.

06:42.110 --> 06:43.080
Come on left.

06:43.160 --> 06:51.200
This ensures that only the configuration of the database path is updated and that there is no attempt

06:51.200 --> 06:59.660
to copy the data files to a new location after their files are manually moved or corporate and the configuration

06:59.660 --> 07:00.970
has been changed.

07:00.980 --> 07:09.870
You can remount the database with the mount data base command let out type mount data base did the 20

07:10.140 --> 07:14.180
know that you can skip identity parameter.

07:14.180 --> 07:20.630
At this point the database will be brought on line and the move operation will be complete.

07:20.630 --> 07:27.660
Now let's look at an example of how we can use the shell to move databases in the Balkh.

07:27.740 --> 07:38.390
Let's say we have added a new disk to the next one server or the X1 Soror and using the last drive letter

07:38.600 --> 07:45.440
and all the database needs to be moved to this new disk under other databases through a directory.

07:45.440 --> 07:49.020
The following code will be used to perform the move.

07:49.190 --> 07:57.110
In this example we use a get mailbox database command to retrieve a list of all the mailbox databases

07:57.200 --> 08:02.410
all the x y and Sorber as we loop through each mailbox database.

08:02.420 --> 08:11.360
Remove the file and look paths under the paths Golombek select database folder in a subdirectory that

08:11.360 --> 08:13.880
matches the name of the database.

08:13.910 --> 08:20.120
You can type this code straight into a shell or save it in an external doc.

08:20.120 --> 08:23.550
Be a swell file and run it as a script.
