What's going on, guys? It is Bernardo. And today is all about migrating your
SCCM database to another server. So let's get right into it. All right. So
during this video or when I was taking a lot of the snapshots, I had notes. I was following my
notes as best practice. Well, for me, I like to take notes before I go into the physical
machine or inside the virtual machine before I do anything and just, you know, I could reference it.
So the first thing that I did was I snapshot both machines that I am going to be modifying.
The first machine would be my new database server and SCCM server. So
I just make sure you take a snapshot. So in case something happens you are able to
go back in time to a clean, stable environment. So within your SCCM server,
you want to open up management studio and you want to run the following commands.
Now, this is a huge script, which hopefully I will provide it to you guys, but when you run it,
you're going to get this. This is basically getting all the security accounts as well as
the passwords and all that stuff. But this right here, you need to actually select it
right click on it and click on copy. Open up notepad and paste that information and save it
because we are going to be using this pretty soon.
Now, next thing that we need to do is within your SCCM server, we are going to open up your Windows
File Explorer and wherever you download it or install your configuration manager, you're going
to open it. So for me, it was on the D drive, so I open up the D drive. Within the D drive,
I went inside programs and files from here I went to Microsoft Configuration Manager within here.
I went inside the bin folder. Within the bin folder, I open up the x64 and within the x64
you're going to find the 409 now, but you're actually going to go inside 00000409. And within
this folder, we we need to use this particular executable file, but I am going to hold the shift
key and right click anywhere inside the folder and you want to do is select open command window here.
Awesome. Now the following command that you're going to run is this
we need to stop every single service within your SCCM environment. Yes, it's true. You are able to
go inside the start menu type in services Let the service's application load up and
then locate every single configuration manager service and then right click on it and stop it.
But this utility actually does everything for you in one shot. So once you run this command
and you hit enter and it is going to stop every single component within your SCCM environment
because you need to stop it to do the rest of the steps. Once it's done,
we need to do one more thing. We're going to click on Start and type in PowerShell
and we are going to right click on the Windows PowerShell and run it as an administrator.
Now we need to stop a couple of services because apparently that utility doesn't stop it.
So the first command is to stop the AI. Now the AI is the asset intelligence services for your
SCCM you're going to hit into, for me, an error out because I don't have this particular service
running within my environment. But if you do, make sure that you run this command to stop it.
Now, the following command is the configuration manager update
hit enter. If everything works well, you shouldn't get any red text and the last
command would be your SMS notification server hit Enter and again, you shouldn't get any problems
and then you good to go. Now, next thing that you need to do is go back inside your
database management studio and we are going to select our database right click on it.
We're going to go to task and we're going to do a backup. Now, within backup you are able
to change the destination. I left everything as the default, but what I did within my environment
is I went inside media options and I enabled verified backup when finished
and perform a checksum before writing to media. Once you do all that, click okay.
It is going to start executing and backing up your database. Once it's done,
you're going to get this nice little dialog box that states the backup of the database.
X, Y, and Z completed successfully. You're going to click okay.
And from here we are going to right click on your database node and we are going to stop it.
You're going to get this warning. Do you want to stop it? Just click yes.
You're going to get another warning. Do you want to stop the server agent?
Click yes here. Once it's done, your database is completely down. The next step is taking
that backup file and then copying it into your new database server. As you can see,
I went into the C dollar sign within my database server and I dropped that backup file on the
desktop as well as that migration information that we retrieved at the very beginning.
I also copied that over into the desktop on the database server because we are going to be needing
that particular script to to run. So once that's done on the database server, on your new database
server, we are going to right click on the start menu and then open up computer management.
And within computer management, we are going to go inside local users and groups.
Within groups we are going to highlight administrators and we're going to double
click on it. We're going to click on ADD and within here we're going to click on object
types and click on computers and click okay. The reason that we did that is because you want your
SCCM server to have full admin rights, full local admin rights to the new database server.
If you don't do this, the migration and the cut over to the new database server with the SCCM
database is going to fail. You don't want that. So make sure you enter your SCCM server here,
click. Okay, apply it. Okay. Once you do that within your SCCM server, we need to restore
our database. Now open up within your new database server,
your management studio and within databases you're going to right click on the database node
and we're going to do a restore database within Restore database.
We are going to click on device within device. We're going to click on the three little dots
within here. We're going to select our database file. So let's click on ADD and we're going to
locate that BAK file our database file. Now, for me, it wasn't locating the database file within
the desktop. So what I had to do is drop it inside the root of the C drive, right?
Once I did that, the BAK file was able to be seen. So I selected it and clicked. Okay.
Clicked. Okay. Here within here you are able to go inside files and you will see that originally
the data and the log files were located and the D drive and it's
going to be restored on the C drive. You are able to change it, but it's up to you.
I left it as the default. I don't mind it dropping it inside the C drive,
but within your environment you could change that.
You're going to click okay. It's going to start restoring. Once it's completed,
you're going to get this dialog box stating that the restore was successful click okay. Now
if you open up your management studio, you're going to see that your database was restored.
Awesome. We need to run a couple of things and the first thing that
we need to run is the following. We need to enable clr on to the database,
right? The next one that we need to do is run the following script. Now,
this is the information that we grab at the very beginning. You need to run it.
That's the reason why I told you guys to save it on the notepad
run it. Once you've run it, you should get this. This is basically taking all
of the log in information from the old database and placing it into the new database.
Once you run that, we need to run the following. We need to enable the broker within the database.
So you're going to run this. The next thing that we need to do is set trustworthy on run
that. And the last thing that we need to do is run the honor broker. Once you run,
this it should run successfully All right. So if you want to check if the broker,
the honor broker and the trustworthy was turned on correctly, you're going to run the following.
Once you've run the following, locate your SCCM database and you're going to see all ones. Once
you see all ones, that means that everything was successfully enabled. The next thing that
we need to do is restart all your services within your SCCM Server. The best way to
do that is just restart your SCCM server. Once your SCCM server is up and running,
log in and you want to click on start and locate the Microsoft
Endpoint Manager folder and we want to locate configuration manager set up.
So we're going to load that up. So from here we're going to click on next
we want to perform a site maintenance or reset the site. So click next here and we are going to pick
the following. We want to modify our database server configuration and click next there.
Now, by default, it is going to give you your old database server the full qualified domain name.
So change it to the new one and you're going to click next there.
For me within my environment, I actually received an error and I received this right.
The server account on the database instance is not supported. Click on the logs to view
it. So I clicked on logs and I noticed that my database service account was using NT services.
So the way that I had to fix this was actually go inside my database server,
open up the server configuration manager and just basically locate
the database service and you're going to just right click on it, go to properties
and within the log in you're going to see the problem. It's actually using the NT
service. I think best practice is to actually use a domain account, but for my environment I
clicked on built in accounts and I clicked on the dropdown menu and I picked local system.
I applied it once you click Apply, it's going to give you this warning, so click yes.
Once everything is done, click okay and then you're able to just go back
inside your SCCM server, establish that connection,
give it the correct database name, click on next. And if everything was working well, you should see
that is trying to stop all the configuring manager services and give you some time.
You're going to see all green checkmarks and then you're able to close it. Now, next thing that I
did within my environment is within my SCCM server. I open up the server manager studio.
I located the old database and I right clicked on it and I went to basically
task. And within task I just basically took it offline and that's it, right?
And I close out of it. Now, next thing I do was just basically open up your SCCM console,
make sure it's running. The first thing that happens is when you open up your SCCM console it
is trying to establish the connection into your database. So if it opens up, you're good to go.
Another way that you could check is if you click on administration, go inside site configuration,
go to server and site system roles, you're going to see a new system which would be your database.
If you select your database, it's going to have site system roles already installed into
it. It's going to have the components server, the site database server and the site system.
How awesome is that? And I said, Guys, that is how you basically migrate your SCCM database to
another server. And hopefully guys enjoy and I catch you guys on the next one peace out.