Micetro by Men&Mice

Latest versions

Search all documentation

Child pages
  • Migrating the Men & Mice Suite database from SQLite to MS SQL Server
Skip to end of metadata
Go to start of metadata

Create the database

Our knowledge base contains an article that describes the process of creating the database and configuring it: 
Using Microsoft SQL Server as a database server for the Men&Mice Suite.  
The remaining instructions below assume that you have created the mmsuite database in MS SQL and that you also have a preferences.cfg file with information on connecting to the MS SQL server.  When Men & Mice Central connects to the MS SQL for the first time, it will create the necessary tables.


 - Create a directory on the Men & Mice Central server, or if possible, directly on the SQL Server (faster) and call it "Migrate"
 - If SQL Server is not running on the Men & Mice Central server, download and install the SQL Server Native Client from Microsoft 
 - Extract the attached ConvertDatabase2.10.zip file and copy the extracted files to directory to the "Migrate" directory. The "Migrate" directory should now contain a PowerShell script used to migrate the database from SQLite to MS SQL, as well as two SQLite DLLs (redistributed from system.data.sqlite.org) under the folders x32 and x64
 - Stop Men & Mice Central on the server
 - Copy the mmsuite.db file into the "Migrate" directory.  Location of the mmsuite.db file depends on the version of Windows on the Men & Mice Central server (see this Location of Men and Mice Central data directory), but it is typically in either of these locations:
Windows 2003 - C:\Documents and Settings\All Users\Application Data\Men and Mice\Central\
Windows 2008 - C:\ProgramData\Men and Mice\Central\

Migrate the database to MS SQL

 - in the PowerShell window type the following command:


> cd C:\Migrate
> .\ConvertDatabase2.ps1 -sourceDbFile .\mmsuite.db -database mmsuite -ServerInstance [DATABASE_SERVER] -username [USER NAME]


or if your account has access to SQL server, you should use the -useWindowsAuthentication switch:

> .\ConvertDatabase2.ps1 -sourceDbFile .\mmsuite.db -database mmsuite -ServerInstance [DATABASE_SERVER] -useWindowsAuthentication


If the script complains about not being able to connect to the database then you probably have to add \[INSTANCE_NAME] to the -ServerInstance variable, like:


> .\ConvertDatabase2.ps1 -sourceDbFile .\mmsuite.db -database mmsuite -ServerInstance\INSTANCENAME -useWindowsAuthentication


and/or a custom TCP port to connect to:

> .\ConvertDatabase2.ps1 -sourceDbFile .\mmsuite.db -database mmsuite -ServerInstance\INSTANCENAME,12345 -useWindowsAuthentication
The script may take a few minutes to run, depending on the size of the database.


If the script returns an error that it can't load the SQLite DLL please check if the DLL that is located in the X64 or X32 sub-directory is "Unblocked". Right-click on the DLL and select Properties and press the Unblock button.
Please note that Windows might refuses silently the Unblock action. You can check this by re-opening the Properties and if it still shows the Unblock button it's still blocked.
In this case just take a copy of the DLL and delete the original DLL and Unblock the copy and it should work.


Start Men & Mice Men & Mice Central

 - make sure the preferences.cfg file is using the MS SQL server
 - go to "Services" and start Men & Mice Central

Now Men & Mice Central will connect to the MS SQL server and use it as a data store.