Loading…

Andrew J. Price | Technical Blog

Office Servers and Services MVP | Founder of UC and Cloud Day | Founder of Microsoft Cloud User Group

Moving your Skype for Business Database LogPaths – When your Databases are deployed in SQL AlwaysOn

Hello Readers

In this scenario we will look at moving your SQL LogPaths to the correct drive location after publishing your Skype for Business Topology, all databases have added to SQL Always On Availability Group . This can be a common issue, when publishing the databases and not specifying the Database and Log locations. I am also going to generate the expected errors you may receive if you do complete the required steps

Capture1

 

The affected Databases are normally

  • ABSStore
    • rtcab
  • ApplicationStore
    • cpsdyn
    • rgsconfig
    • rgsdyn
  • ArchivingStore
    • LcsLog
  • MonitoringStore
    • LcsCDR
    • QoEMetrics

So here is my environment information

  • Skype for Business Enterprise Edition (3x Front End Server)
  • SQL 2014 Always On (2x SQL Servers)

All Skype for Business Enterprise Edition Front Ends have been shutdown so there no active connections to the Back End Databases.

Now on your Primary SQL Server open SQL Management Studio

Open AlwaysOn High Availability –> (Your AlwaysOn Name) –>Availability Databases

Capture2

Right Click your first chosen database to move, in this post I will be moving CPSDYN

 

Right Click CPSDYN –> Click Remove Database from Availability Group..

 

Capture3

Press OK

Capture4

Now go to Databases –> Right Click cpsdyn –> Click Tasks –> Click Detach..

 

Capture5

Tick Drop Connections –> Press OK

Capture6

You can now move your LogPath Folder to the correct drive location but however if you look at the image below

Capture7

 

There are no folders for

  • ABSStore
  • ApplicationStore
  • ArchivingStore
  • MonitoringStore

You will need to create the required folders

  • <Drive>:\ABSStore
  • <Drive>:\ABSStore\<SQL Instance>\LogPath
  • <Drive>:\ApplicationStore
  • <Drive>:\ApplicationStore\<SQL Instance>\LogPath
  • <Drive>:\ArchivingStore
  • <Drive>:\ArchivingStore\<SQL Instance>\LogPath
  • <Drive>:\MonitoringStore
  • <Drive>:\MonitoringStore\<SQL Instance>\LogPath

You will also need to create these locations on the Secondary SQL Servers (If you do not complete this step you will receive an error later on in this process which I will cover off)

Move the cpsdyn log database to the new location you created on the Primary Server Only

 

i.e E:\ApplicationStore\<SQL Instance>\LogPath\cpsdyn.ldf to F:\ApplicationStore\<SQL Instance>\LogPath\cpsdyn.ldf

 

We will also need to delete the database from the Secondary SQL Server, the Database will be recreated once AlwaysOn is enabled again for the that database.

 

We now need to add the database back to the SQL Server.

Right Click Databases –> Click Attach

Capture8

Click Add

Capture9

Search for the location of the .mdf file which will be in the original location as shown below, Select it and Press OK

Capture10

Click on the Log Button (Highlighted in yellow)

Capture11

Browse to the new LogPath and select the file –> Press OK

Capture12

Press OK

Capture13

Right Click Availability Databases –> Click Add Database

 

Capture14

Press Next

Capture15

Tick cpsdyn database –> Press Next

Capture16

Specify your Data Synchronization preference, for this post I am using a replication location I used when setting up AlwaysOn –> Press Next

Capture17

Press Connect –> Press Connect –> Press Next

Capture18

Below now shows all the expected errors you may receive if all the requires steps above haven’t been completed

Capture19

Chapter 1. Error Messages

Capture20

Checking whether the database already exist on the secondary replica resulted in an error.

Databases (Name of DB) already exist on the server instance that hosts secondary replica DB02\SFB

 

Section 1. Resolution

Delete SQL Database from Secondary Replica

 

Capture21

Checking whether the database already exist on the secondary replica resulted in an error.

The following folder locations do not exist on the server instance that hosts secondary replica DB02\SFB

<Drive>:\CSData\ApplicationStore\<SQL Instance>\LogPath

 

Section 2. Resolution

Check Folder Location as specified in the error

 

Capture22

Checking whether the database already exist on the secondary replica resulted in an error.

The following database files already exist on the server instance that hosts secondary replica DB02\SFB

<Drive>:\CsData\ApplicationStore\<SQL Instance>\DbPath\cpsdyn.mdf

Section 3.

Section 4. Resolution

Delete SQL Database from Secondary Replica

 

Once the above errors have been resolved, Re-run the Validation Check and Press Next if successful

Capture23

Press Finish

Capture24

Press Close

Capture25

 

Now, Delete and Repeat this process for all affected Databases

 

Regards

Andrew J. Price

2 thoughts on “Moving your Skype for Business Database LogPaths – When your Databases are deployed in SQL AlwaysOn

  1. Hi Andrew,

    Congrats for your well done, organized and functional article.

    Could you please clarify me if this folder structure is really mandatory?
    :\ABSStore
    :\ABSStore\\LogPath
    :\ApplicationStore
    :\ApplicationStore\\LogPath
    :\ArchivingStore
    :\ArchivingStore\\LogPath
    :\MonitoringStore
    :\MonitoringStore\\LogPath

    I could create something like this:
    :\MicrosoftSQLServer\\
    :\MicrosoftSQLServer\\

    And distribute the database files. Couldn’t I?

    1. Hi Gari

      I would keep the folder structure as above so you can easily identity which database belongs to which function i.e. MonitoringStore but nothing is stopping you from putting them in a subdirectory like

      :\MicrosoftSQLServer\\LogPath instead of the sitting on the root directory.

      Andy

Leave a Reply