MIVCR -How to restore SQL databases and useful commands.

Recently i had a customer which had outgrown the SQL database size limit in SQLEXPRESS.

Not the hard drive size.

This caused the MIVCR software to start deleteing PVD’s!

We had to move the DB’s from SQL Lite to Full SQL

Mitel provide a useful document on how to do something like this.

This is not a complete how, to but rather some useful notes to aid you while you follow the Mitel instructions from the manuals

However i ran into some trouble where the “database copy” housekeeping function no longer worked. it just locked the SQL stopping new calls being added to SQL and the MIVCR client would crash with an error around accessign SQL

We decided that we needed to move the SQL off the local MIVCR server and tidy up the local SQL

So i followed the Mitel documentation and installed Full SQL on another server and restored the database

Next step after restoring the DB to a new SQL server is to re-configure the MIVCR software to use the new SQL server
This is done via the "Network Configuration tool"
This can be found inside the MIVCR tool, if the services are running.
OR its a standalone application if you need to access it when the MIVCR software in not accesable due to the services being stopped
Where to find networkconfiguration inside the Admin software
Where to find netweok configuration outside the MIVCR software
This field is where you put the SQL instance name .E.G. SQLEXPRESS
This is where you put the IP/FQDN of the SQL server E.G. localhost

Then we hit another issue where the MIVCR software gave an error on login advising the database user already existed in the database and it could not continue

To over come this issue we ran a SQL command from sql management studio

To resolve this I ran the following SQL commands

1) Try changing the database owner

use CTSDevices

SP_Changedbowner ´Oaisys6E7FC84D´ — Changing the OWNER of the database — throws the error The Proposed new database owner is already a user or aliased in the databas

2) Drop the User

use CTSDevices
SP_DROPUSER ´Oaisys6E7FC84D´ — Dropping the Oaisys6E7FC84D user from the user database

3) Make the Oaisys6E7FC84D user Database owner again

use CTSDevices
SP_Changedbowner ´Oaisys6E7FC84D´ –Changing the OWNER of the database

The MIVCR software then upgraded the database and continued to load where i could login and check the configuration was still present

Now i wanted to be sure the new calls were being added to the correct SQL.

I still had a local SQL and now a remote SQL

I found these two commands useful

Select top 10 * from calls
order by StartDateTime desc

This command shows you the last 10 calls recorded in the SQL DB
So if it shows a call recorded just now, you know this is the database that new calls are being recorded into
If it shows only calls from before the time you made the change to the configuration then you know this is the old database

Select count(*) from dbo,calls;

This shows the amount of calls recorded in the DB

If this is different to the amount shown in the MIVCR client then you know its the wrong SQL DB

Note: You may have issue with access rights due to the MIVCR services running as a local user who has no rights on the remote SQL server

If you chnage the servies to run as a domain user which has access rights on both the MIVCR server and the remote SQL server you should be fine.

You might also find this post useful for MIVCR SQL DB issues

Leave a Reply

Your email address will not be published. Required fields are marked *