Search This Blog

Tuesday, June 9, 2015

Move SCCM database to another drive

Lets try to move our SCCM database to another drive.

Always make sure you have a good backup and a rollback plan if something goes wrong Smile

And make sure you have system administrator permission.

First start an administrative command prompt and stop all SCCM services.

You can use the command preinst.exe /STOPSITE from your SCCM installation.

Mine is located in the following path:

"C:\Program Files\Microsoft Configuration Manager\bin\X64\00000409\preinst.exe" (the last folder is dependent upon the language of the product, 00000409 is for the English version).

image

image

Next start SQL Management Studio.

image

If you select properties on the current SCCM database you will be able to find the current file location:

image

Select Files to find the current Path:

image

Now Detach the database:

image

Select Drop Connections and hit OK.

image

The database will disappear from the Databases folder.

Copy or move the SCCM database files to the new location:

image

Attach the database again:

image

Click Add:

image

Select the MDF file you copied (in the new location) and click OK:

image

Click OK again:

image

Select the database you just attached and click New Query:

image

Run the command:

ALTER DATABASE <ConfigMgr DB> SET TRUSTWORTHY ON

image

Change owner to sa:

EXEC sp_changedbowner 'sa'

image

Ensure that Isolation Level is set to read committed snapshot by running the command:

DBCC USEROPTIONS

image

If it is set to anything else than read committed snapshot then run the following commands, if isolation level is read committed snapshot then ignore next step.

ALTER DATABASE <ConfigMgr DB> SET ALLOW_SNAPSHOT_ISOLATION ON

ALTER DATABASE <ConfigMgr DB> SET READ_COMMITTED_SNAPSHOT ON

image

Note: You might have to switch the SQL DB to Single User mode before running the two commands. Once done, change it back to Multi User mode.

Finally start SCCM Services using Service Manager or restart the server.

After moving the System Center 2012 Configuration Manager SQL Site Database to another drive, creating a new Software Update package or a new application fails

3 comments:

  1. Just tried this for System Center 1802 on Server 2016 with SQL 2017. It worked great! Thanks!!

    ReplyDelete