• No results found

Upgrade from Express to Microsoft SQL Server

In document SafeCom G3 Administrator s Manual (Page 97-105)

3 Planning your SafeCom solution

4.5 Upgrade from Express to Microsoft SQL Server

You can use the supplied scBackup (3.9.6) to backup the SQL Server 2008 R2 Express database and use it to restore the backup once you have changed to Microsoft SQL Server as described below:

1. Create intermediate SQL user: safecominstall (4.2.12).

2. Stop the SafeCom Service (4.5.1).

3. Change Windows Registry to reference SQL Server (4.5.2).

4. Change the dependencies on the SafeCom Service (4.5.3).

5. Delete intermediate SQL user: safecominstall (4.2.13).

Note: For this to take effect you MUST restart the computer.

Once you have performed the above successfully you may uninstall the SQL Server 2008 R2 Express database as described in 4.2.22.

4 Installation

4.5.2 Change Windows Registry to reference SQL Server

1. Open the Registry Editor and browse to:

HKEY_LOCAL_MACHINE\SOFTWARE\

SafeCom\SafeComG3\Database

If a 32-bit SafeCom G3 version is installed on Windows 64-bit:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\

SafeCom\SafeComG3\Database 2. For each these registry settings:

DBServerNameCore DBServerNameEvent DBServerNamePurse DBServerNameTracking 3. Change the value from:

computername\SAFECOMEXPRESS

to one of the below two. It is NOT possible to specify the IP address instead of the computername.

computername

You only need to specify the computername if there is no named instance of the SQL Server. There is no named instance of the SQL Server if Services only lists MSSQLSERVER.

computername\instancename

You need to specify both computername and instancename if there is a named instance of the SQL Server. The instance name can be seen in Services. The named service will appear in Services as MSSQL$instancename. The instance name is case sensitive.

4. Click OK to save the settings.

5. Repeat step 3-4 for the remaining registry settings.6. Exit the Registry Editor.

4 Installation

4.5.3 Change the dependencies on the SafeCom Service

1. Open the Registry Editor and browse to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\

Services\SafeCom Service

2. Double-click DependOnServiceand replace MSSQL$SAFECOMEXPRESS with the instance name of the SQL Server (MSSQL$instancename). Use

MSSQLSERVER if there is no named instance. See also step 4 in 4.5.2. The instance name is case sensitive.

If the SQL Server is installed on another computer you should right-click DependOnService and click Delete.

Note: For this to take effect you MUST restart the computer.

4 Installation

4.6 Multiserver installation

Prerequisites:

 A SafeCom license key code (4.9) that includes SafeCom Enterprise Server. The license key code is based on the computer name (4.9.1) of the SafeCom master server.

 The SQL master server must run Microsoft SQL Server 2008 or 2005. It must be licensed and installed (including replication option). Microsoft SQL is quite memory intensive and basically the more memory the better.

2 GB RAM is a good start.

 The SQL master server must be defined as an SQL distributor and publisher.

The SQL master server must be configured to use Authentication method SQL Server and Windows.

 The SQL master server must have the following three services running otherwise the one-way replication from the master to the slaves does not work:

o SQL service (best practice is to use a standard domain user, e.g.

SqlRun)

o SQL Browser

o SQL Agent (best practice is to use a standard domain user, e.g.

SqlRun - the same as for the SQL service)

 The SQL master server, SafeCom master server and SafeCom slave servers must be part of the same domain or workgroup.

 The SQL master server must know the SafeCom slave servers by DNS and vice versa.

 The SafeCom master server must know the SQL master server by DNS.

 The SafeCom master server must know its SafeCom slave servers by hostname or IP address and vice versa.

 The firewall for both the master server and the slave servers must either be turned off, or a static SQL port must be set.

If you set a static port: (refer to section 4.2.6)

o Make sure to open the static port in the firewall.

o Open the port 1434.

o Make sure the SQL Browser service is running.

4 Installation

 Make sure that the master server has writing access to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data. The standard domain user set in the SQL agent, must as a minimum have access right set to Modify.

Warning: When you add a SafeCom server to a SafeCom master server’s group the SafeCom slave server loses its existing data, including: devices, users, and print jobs.

Note: Refer to 4.5 if you are upgrading from a running SafeCom Server with Microsoft SQL Server 2008 R2 Express to Microsoft SQL Server.

4.6.1 Overview

1. Do a SafeCom Server installation on each slave server (4.2.2).

2. Do a SafeCom Server installation on the master server. Select Advanced installation and Use an existing SQL Server (4.2.2).

3. Use SafeCom Administrator to install the license key code on the master server (4.9).

4. Set SQLSERVERAGENT to automatic startup (4.6.2).

5. Add the other servers to the master server’s group (4.6.3).

6. Delete intermediate SQL user: safecominstall (4.2.13).

7. Check that replication is working (4.6.4).

8. Enable Offline tracking (9.9) if tracking is used.

The Microsoft SQL Server is installed in the folder:

C:\Program Files\

Microsoft SQL Server\MSSQL

If a 32-bit SafeCom G3 version is installed on Windows 64-bit:

C:\Program Files (x86)\

Microsoft SQL Server\MSSQL

4.6.2 Set SQL Server Agent to automatic startup

The SQL Server Agent (instancename) on the SQL server must be set to Automatic startup in Services.

4.6.3 Add the other servers to the master server’s group

Use SafeCom Administrator to add the other servers to the master server’s group. The server you add must be running. Refer to section 6.3.

4 Installation

4.6.4 Check that the replication is working

On SQL 2008 and 2005:

1. Open SQL Server Management Studio.

Verify that the SQL Server Agent is running.

Right-click SQL Server Agent and click Properties and verify that Service state is Running.

 Monitor the replication.

Browse to Replication and Local Publications and right-click [sccore]:sccoreTrans and click Launch Replication Monitor.

The Replication Monitor:

 If the replication is working status symbols should be colored green only and NOT red.

To check any latency click on the Tracer Tokens tab and click Insert Tracer.

Click on the Agents tab and check that agents are running.

4 Installation

The following tables must be selected for replication:

 scAliases

Note: Make sure to check the right ones!

4.6.5 Repair replication

If a replication fails or is interrupted, it can be repaired from SafeCom Administrator.

Tip: Use Microsoft SQL Management Studio to back up your replication configuration, using the Generate Script button.

Note: This feature can only be used if Setup replication was checked when the slave server was added (6.3.2).

1. Right-click the slave server and select Repair replication.

2. Click OK to confirm and the replication repair begins; the slave server's subscription is deleted and created again.

3. When the message "The replication was repaired with success!" appears, the replication repair is completed successfully.

4 Installation

4.6.6 What happens if servers or network connections are down?

In order to answer this question we will first explain the concept behind the SafeCom multiserver solution.

The SafeCom master server uses SQL replication to propagate the entire configuration to the SafeCom slave servers. Initially it does a snapshot replication and subsequently it only replicates the changes (transactional replication).

This way all the SafeCom servers have the configuration, including the network details of each other. This allows the servers to communicate directly, rather than having to rely on the SafeCom master server. You can say the SafeCom servers become autonomous.

The replication from the SQL server to the SafeCom slave servers is one-way.

Changes to the configuration are possible only when the SafeCom master server and SQL master server are running. This is secured by the system as users with special rights always have the SafeCom master server as their home server.

 If the master server is down it is not possible to make any configuration changes (Administrators cannot log in to SafeCom Administrator).

 If a SafeCom server is down users who have this SafeCom server as their home server cannot log in. However, push printers configured to allow printing at all times can still be used on the servers running. SafeCom servers still running will continue to serve the users who have those servers as their home server.

Additional resilience can be achieved by specifying a prioritized list of failover servers (6.6) that users should be moved to in the event that their home server becomes unavailable.

 If the network is partially down, it is still possible to print and roam between the servers as long as they can still reach each other (they are not affected by the part of the network that is down). If the network is completely down nothing is possible until the network is up again.

4 Installation

4.6.7 Reinitialize the subscription

If a SafeCom slave server has been restored you may wish to reinitialize the replication from the SQL server to the SafeCom slave server.

On SQL 2008 and 2005:

1. Click Start, point to All Programs, Microsoft SQL Server 2008 (or 2005) and click SQL Server Management Studio.

2. Log in to the SQL server and browse to Replication, Local Publications and [sccore]:sccoreTrans.

3. Right-click the subscription of the SafeCom slave server and select Reinitialize All Subscriptions.

4. Check Generate the new snapshot now. Click Mark For Reinitialization.

Section 4.6.4 describes how to check that the replication is working.

4.6.8 Prevent the subscription from expiring

The replication from the SQL server to the slave may get dropped if the subscription is not synchronized within 72 hours.

On SQL 2008 and 2005:

1. Click Start, point to All Programs, Microsoft SQL Server 2008 (or 2005) and click SQL Server Management Studio.

2. Log in to the SQL server and browse to Replication, Local Publication.

3. Right-click [sccore]:sccoreTrans and select Properties.

4. On the General page check Subscription never expire, but they can be deactivated until they are reinitialized. Click OK.

In document SafeCom G3 Administrator s Manual (Page 97-105)