Skype for Business 2019 is the latest and greatest on-premises UC product from Microsoft, and if you are deploying it in an existing environment as part of your journey to the cloud you may have some legacy call data in your Lync 2013 or Skype for Business 2015 servers. In this guide, we take a look at how to import that existing data into our new Skype for Business 2019 deployment.
Why should I do this?
As part of building your brand new Skype4B 2019 Pool, you might want a single point of truth for all your QoE data, but don’t want to lose your existing Lync 2013 calls. Or maybe you are looking to take advantage of the new Call Quality Dashboard connector with your legacy data?
Unfortunately, Topology Builder and the QoE deployment wizard don’t give you any sort of migration utility/steps so you might be forgiven for thinking this isn’t possible.
Well with a little bit of SQL fiddling, we can!
Disclaimer: I’m NOT an SQL guru, as with most things, I know enough to be dangerous. Always follow the guidance of your DBA or check out more information from the SQL community like fellow MVP and Purplonion Martin Cairney
Okay, So this guide is going to assume that you have Skype4B 2019 installed already and have a Lync 2013 pool to migrate the data from.
Well as you might have noticed during setup, Topology builder won’t let you select your existing QoE Monitoring database for the 2019 Pool.
This is because the schema versions don’t match and differ quite considerably. as we can see with a quick Test-CsDatabase
We also can’t just Install-CsDatabase -DatabaseType Monitoring -SqlServerFqdn sql.ucmadscientist.com -SqlInstanceName Foo_Lync -update as the old SQL version is not supported on 2019, we need at least SQL 2016
Well, we can always just install the Monitoring Database on the new server defined in the topology, but then we lose all our call history data.
If only there was some way to import it? There is!
First off, you will need to do this during a maintenance window. As any CDR and QoE data for calls made between when you start and when you finish will be lost.
By the end of this guide, the new 2019 QoE Database will be our single source of truth and all Front End Pools should be pointed to the new QoE database.
(Even if they are still on Lync 2013)
Firstly, this requires you have already installed the databases on the new SQL box using either Topology Builder or Install-CsDatabase on your new server with blank data, This process will also overwrite any existing data in your 2019 QoE database! So only do this if you haven’t started migrating users yet.
From the new SQL server, or a management server. Start SQL Management Studio and connect to your new Monitoring Box.
Your SQL admin may not have installed this. If not, the best practice is to install it on a management box rather than the SQL Server itself. You don’t install Outlook on an Exchange server, do you?
Repeat the process to connect to your old Lync Monitoring DB
Now we can either Backup the databases up and Restore them or use the copy database wizard (I don’t cover that in this guide, you will still need to upgrade the databases afterward)
Backup and take the existing databases offline
On the old server expand Databases and look for LcsCDR, Right-click on it and click Tasks > Back Up…
All we need to do is make sure we select Copy Only Backup. this is done so we don’t purge log files and break our backup software. Take note of the file location and click OK
Repeat the process for the QoEMetrics database
You should now also Detach the old databases to stop them from being used.
Right-click LcsCDR, select Tasks and Detach…
In the new window, Select Drop Connections and leave all other options at defaults
Click OK and wait for the Database to go offline.
Repeat for the process again for QoEMetrics
Copy the new backup files across to the new server using your favorite method
Restore the backup files over the top of the existing DB’s
On the new server switch back to SQL Management Studio
Expand Databases, Right-click on LcsCDR and select Restore > Database…
In the new window change the source to Device and click …
Click Add, select the LcsCDR data file in from where you copied it and click OK
Navigate to the Options tab, select Overwrite the existing database
Confirm databases and files match on the General tab and click OK
Dismiss the completion prompt by pressing OK
Now repeat the process for the QoEMetrics database!
Upgrade the Data
Okay, that’s it. We have copied the DB from one place to another. Now we need to upgrade it.
From your Skype for Business Front End or Management Server run the following command to update the new database to the new schema
Install-CsDatabase -DatabaseType Monitoring -SqlServerFqdn sql.ucmadscientist.com -SqlInstanceName Foo_Lync -Update
Skype will then proceed to remove all the old schema and import all the new schema. But your existing call data will remain.
Don’t forget to re-add any user account permissions for your SSRS service account if your account name has changed for the new build by going to Servername > Security > Logins and navigating to the user mappings option. Then add DB_DataReader and ReportsReadOnlyRole to LcsCDR and QoEMetrics and pressing OK
Skype Topology Changes
Now that we have upgraded the QoE database, we need to let all the Front Ends know about the change.
Open Topology Builder and then for each Registrar Pool (Front End, or SBA pool)
Right-click the registrar and Click Edit Properties…
Scroll down the form and find the section labeled Monitoring (CDR and QoE metrics)
Change the dropdown box to your new QoE server and Click OK
Repeat for each FrontEnd/SBA
Publish your Topology by clicking Action > Topology > Publish… and following the bouncing ball.
There is no need to re-run Step 2 in the deployment wizard or to restart services. The FrontEnds will pick up this change via replication.
Copy DB method
(Use this instead of Backup / Restore if the servers are near each other and you cant transfer files between them)
On the old server expand Databases and look for LcsCDR, Right-click on it and click Tasks > Copy Database
Click Next on the Copy Database Wizard
The correct Source DB should already be selected, click Next
In the Destination Server page, type the name\instance of the server you are migrating the data to and click Next.
On the next page select the Use SQL Management Object method if you are doing a test run, otherwise, check Use the detach and attach method and click Next.
This allows us to do a trial run and not knock out the prod DB
On the next page, we will get a list of databases in each instance. Make sure to select LcsCDR and QoEMetrics for Copy or Move depending on if this is a test run or not. You will see a message that the DB’s already exist at the destination
(This screenshot contains other databases as the Backend and Reporting are Co-located, they can be ignored)
On the next page remove the “_new” suffix from each DB and select the Drop and database on destination server with the same name option
Don’t forget to update the file paths with the correct instance paths!
Repeat the process for QoEMetrics
On the Server Object page, just click Next
Leave the package names alone and click next.
On the schedule page, check Run Immediately and click Next.
Confirm everything and click Finish
Wait for magic
Once that completes, upgrade the Database Schema and Topology as per above
Hope this helps someone, and if it did or you have questions, pop them below.