HomeDatabase AdministrationThe PureCM DatabaseScripted upgrade to SQL Server

2.7. Scripted upgrade to SQL Server

Ensure Viability

Before attempting the migration to SQL Server we would advise some capacity/perfomance planning be done in consultation with your Database administrator.   Equally important is that you have an understanding of your backup/restore/disaster recovery options once your PureCM data is held in SQL Server.

Migrating to SQL Server should not affect your Developers/End Users in any way.  They will not need to recreate workspaces or otherwise change their client configuration.

Initial Tasks

Download the attached script to your machine.  It isn't intended to be used unmodified and there's some configuration work you'll need to do. The script itself is written in Microsoft PowerShell which obviously you'll need to have installed.  We recommend using PowerGUI and it's Script Editor which makes life easier but otherwise command line PowerShell is fine if you're comfortable wiith that.

There's a dependency of having PureCM Server 2010-1d (or later) installed on your server prior to performing the upgrade.  You should install the server with the SQL Server database option selected and ensure that it starts up correctly.  It will not initially have your existing repositories or configuration present.  You should ideally then shutdown the PureCM Service (the script tries to do this but could fail if you don't run it with Administrative privileges).

Configurable Items

If you open the script in PowerGUI Script Editor or Notepad, you'll see that the first few lines look similar to :-

# Configurable settings for your SQL Server...

$SQLServer = "localhost"

$SQLUser = "sa"

$SQLPassword = "reallysecret"



Obviously these settings are unlikely to work directly!  You'll need to change them to match your SQL Server environment.  The default is to use SQL Server authentication (i.e. user 'sa') but if you blank out the SQLUser and SQLPassword values it's possibly to use Integrated/Windows authentication if that's configured.

There are some other settings ($ProgDir which defaults to 'C:\Program Files\PureCM\Server' and $DataDir which defaults to 'C:\PureCM\Data') which you may need to customise ($ProgDir may need to be changed to 'C:\Program Files (x86)\PureCM\Server' on 64-bit Windows machines for instance).

The script defaults to creating temporary files in wherever the TEMP environment variable is set to (typically C:\users\myuser\appdata\local\temp or similar).  If there isn't enough space in this location, you may need to customise the setting of the $tempdir variable in the script.  You will need enough space to store the size of the largest repository database with an extra 25% allowance.

Running the Script

Once you've customised the script, you should be able to run it either by pressing F5 in the PowerGUI Script Editor or running 'powershell .\convert-purecmdb-to-sqlserver.ps1' from a command prompt.  If you run into problems with your machine preventing you from running an unsigned script you may need to do 'powershell Set-SecurityPolicy RemoteSigned' to avoid local scripts needing to be signed - PowerGUI can be more convenient in this case!

The script will output the basic configuration details and prompt you if it should continue.  You will need to type 'yes' in order for it to do so.  It should then run through the conversion process.  If you run into problems then you can forward the output to support@purecm.com and we'll try to help you out.

Post Conversion Checks

Once successfully complete, you should try to start the PureCM Service.  You should ideally check that there are no significant errors or warnings in the Windows Event log.

Obviously you'll probably also want to perform your own tests to ensure that the server is functional.  We would recommend that you at least make a connection from the PureCM Client to ensure that all expected Repositories are available.  Creating a workspace is a fairly good way to further check integrity.


Related Pages
This page was: Helpful | Not Helpful