> For the complete documentation index, see [llms.txt](https://help.qtech.co.nz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/server-migration.md).

# Move DATRAN VI to a new server

Plan a DATRAN VI server replacement: roles, licences, SQL Server first, cutover, and the checks that prove nothing was lost.

QTech has produced detailed technical resources to assist all system administrators and IT staff looking at performing DATRAN server and SQL database migrations. Please get in touch with QTech before starting the project as there are differences to other enterprise wide server replacements. As DATRAN is connected to the live telemetry network, it is constantly updating data and logging to the SQL server historian. Experience shows that a planned, staged, and project managed approach to the migration of the mission critical SCADA server machine, gives the best result. Schedule time to do the SQL Server migration first, before the DATRAN Server is done.

{% hint style="info" %}
**Applies to:** replacing a DATRAN VI server or its SQL Server, from QTech's Server Migration Planning Guide V01. Please contact QTech at <techsupport@qtech.co.nz> if you are planning a server replacement and migration. We will email you the most relevant guides and help establish what role you require us to perform.
{% endhint %}

The guide assumes no change to the telemetry network architecture but could form part of a larger plan that includes migration of telemetry network communications to TCP/IP based channels (e.g. Ethernet radio) for example. This could involve staging the migration: firstly by porting of the current DATRAN Tree database (TBD) to the new system followed by reconfiguration to use new communications equipment in a step wise manner once operations have been re-established, thus avoiding complications with fault finding and diagnosis when making multiple changes to the system.

## 1. Plan

| Task                   | Think about                                                                                                                                                                                                                                                                                                                                                                                                 | QTech          |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| Scope                  | Will there be new computer hardware or virtual machine? Single base station or separate SQL server? Is telemetry equipment affected? Are there (telemetry or IT) network communication systems to be replaced?                                                                                                                                                                                              |                |
| Risk assessment        | What are the potentials for data loss at each phase of migration? Is there a backup, recovery or rollback plan? Can the SQL databases be migrated and tested for consistency in advance? The risk assessment should include the means by which data loss during the migration will be detected and what steps can be taken to avoid it or recover from it.                                                  | Can contribute |
| Roles                  | Key activities: IT accounts and permissions assignment and troubleshooting; network communications, routing and port forwarding; client software installation (HMI, OPC-UA, DATRAN applications); system backup prior to migration; operational continuity (alarm processing); SQL Server installation; DATRAN server installation; testing; recovery and rollback, cutover; final verification and signoff |                |
| Estimates and timeline | Estimated time and effort for activities. Preliminary scheduling based on order of work and milestones.                                                                                                                                                                                                                                                                                                     | Can contribute |

To avoid hazards arising from integration of third-party systems (e.g. HMI systems using OPC UA connected to DATRAN) establishment of verification processes and tests at the interfaces may be needed as proof of operation. Consider how suppliers will need to coordinate.

## 2. Before the move

| Task                     | Think about                                                                                                                                                                                                                                                                                                                                                                                            | QTech          |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------- |
| Server specification     | DATRAN and SQL server should be specified separately. Is the installation collocated, local, or over a domain? See [Server requirements](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/server-requirements.md).                                                                                                                                                                            | Can contribute |
| Accounts and permissions | Ensure that accounts are created with the correct access permissions for Domain and SQL access. Specify ports that need to be opened in firewalls. Network shares in place.                                                                                                                                                                                                                            | Can contribute |
| Licences                 | Produce a list of current services and licences. Prepare for new hardware, the means reissuing new licences. Licences are issued for each computer that a service or application runs on. Information regarding the computer name and disk volume IDs will be required by QTech to issue new licences. See [Licensing](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/licensing.md).        | Can contribute |
| Alarm system             | Check to see if failover alarm systems are needed such as SMS Direct. Ensure current alarms are backed up to spreadsheet for comparison with new install during test.                                                                                                                                                                                                                                  | Can contribute |
| Older technology         | Plan for the obsolescence of older technologies such as paging systems, DDE and OPCDA access. How will the communication mediums be connected to the new server (USB/Serial or TCP/Serial ie MOXA)?                                                                                                                                                                                                    | Can contribute |
| Client programs          | Ensure that there is sufficient licence coverage for the number of operators (including remote access ones or via terminal services). Check who is using products like: DATRAN Supervisor, DATRAN Vue (and DATRAN Vue Designer), DLPIDE, DATRAN Historical Trending, DATRAN Reporting, OPC-UA Server, DATRAN Web Trending. QTech can usually supply a report of the licences that have been allocated. |                |
| Connected equipment      | Servers with equipment (modems and adaptors) clearly labelled for movement to new machine. Serial ports and driver settings recorded.                                                                                                                                                                                                                                                                  |                |
| New SQL Server           | Schedule time to do the SQL Server migration first, before DATRAN Server is done (see below).                                                                                                                                                                                                                                                                                                          | Can contribute |

Other points:

* The minimum version recommended for new installations is SQL Server 2016. SQL Express is NOT recommended, it is recommended that MS SQL Server is installed on a separate machine to DATRAN.
* For systems with the DATRAN and SQL server located on separate machines and using a domain controller it is best to create an account for DATRAN (e.g. DATRANService) with domain privileges and access to SQL Server prior to migration.
* Installation of DATRAN services includes relicensing the services and appropriate permissions need to be established for registry access as well as for some application access by services to system and protected or hidden OS folders.
* DATRAN must provide a static IP address for inbound TCP/IP connections via an exposed port. Port assignments are also provided for SQL access, and if message services such as XML Data interface to DATASHED (for SMS alarm notifications to operators) then ports are required for inbound and outbound connections. Ports should essentially be the same as the current installation but the IP addresses will change.
* SQL Management tools should be installed on a machine when configuring SQL Server, new operating systems should be checked that .NET framework is installed properly (for example on some small system implementations .NET 3.5 is not enabled by default on Windows 10).
* The TCP port used by SQL must match that configured in DATRAN (typically 1433). Firewalls must allow data to pass between DATRAN and SQL.

## 3. Move SQL Server first

1. **Check DATRAN's safety nets.** After a restart, historical RTU data logs should be retrieved and checked in the SQL database. Turn on diagnostic logging to disk (see [Backup, restart and disaster recovery](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/backup-and-restart.md#recommendations)).
2. **Create the database on the new instance.** Back up DatranDatabase on the current SQL Server and restore it to the new SQL Server to create the database. Ensure the "DATRANService" user account is added as administrator to SQL Server for ADO connectivity.
3. **Test the connection** to the new SQL Server from the current DATRAN Server. In DATRAN Trending, select **Database > Switch Database**, enter the server name, choose "Use a specific user name and password", ensure DatranDatabase is selected under "Select the database on the server" and click **Test Connection**.
4. **Point DATRAN at the new database.** Once connection is confirmed, change the ADO connection in the current server to write to the new SQL Server during the migration of DATRAN.
5. **Check logging has restarted.** Check that data is written from the DATRAN Server to the SQL Server using either SQL Server Management Studio or DATRAN Trending.
6. Consider logging to the new database from the current server for a while until data is proven to be logging correctly. Then schedule the DATRAN server migration.

If it won't connect or isn't logging, see [DATRAN won't connect to the SQL database](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/troubleshooting/cannot-connect-to-sql.md).

## 4. Move DATRAN

| Task                      | Think about                                                                                                                                                                                                                                                                                    | QTech          |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| Schedule                  | Availability of IT and staff for the scheduled day                                                                                                                                                                                                                                             | Can contribute |
| Back up                   | Including backing up and restoring the SQL database to new machine. Verify database is restored correctly before proceeding with migration.                                                                                                                                                    | Can contribute |
| Support software          | Remote access services. Essential frameworks (.NET)                                                                                                                                                                                                                                            |                |
| Certificates              | Obtain new certificates from QTech and load onto new machine                                                                                                                                                                                                                                   | Can contribute |
| Install DATRAN            | Installer permissions must be correct. Copy TBD to new system reconfigure connections such as ADO connection to SQL Server, server names etc. XML service including users, passwords, ports. XML service HTTPS server. Port forwarding and firewalls. Copy across: Data, ASM/DLP, Alarm Notes. | Can contribute |
| Keep the new server quiet | Use Supervisor to disable all alarms on new server until comms on new server is verified. Disable qcomms and ADO on new server until ready to cut over.                                                                                                                                        |                |
| Licences                  | Obtain from Qtech based on client supplied info                                                                                                                                                                                                                                                | Can contribute |
| Service start order       | Prescribed order for starting services. Virtual machines service start order. Stop and starting ok.                                                                                                                                                                                            | Can contribute |
| Comms                     | Initial checks with new server prevented from acknowledging alarms. Server serial ports (if any) reconfigured in device manager and match TBD. Device drivers installed (e.g. MOXA).                                                                                                           | Can contribute |

* If web trending is used then the port forwarding used in the current system to connect SQL server to the Web Trending service on the web trending web site must be changed to add the port forward to the new system.
* If XML data service is used then port forwards for Datashed need to be reconfigured to the new DATRAN server.

{% hint style="warning" %}
If the new server has a different computer name, rename the old computer node in the TBD to the new name before you start ADO. Otherwise, on V6.68 SP1 and earlier, ADO may replace your SQL logging scripts with the default ones.
{% endhint %}

## 5. Check everything

| Area            | Check                                                                                                                                                                                                                          |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| DATRAN services | Stop and restart. Check licensing all working. Check all site communications. SQL database is updating (logging to database ok). Review trending data for missing data.                                                        |
| Client programs | All instances licensed. All application accessing data. Remote access working. OPC UA systems forming connection between HMI and DATRAN. Web Trending connection valid and updating.                                           |
| Datashed        | SMS notifications and acknowledgments. XDI node value changes. All operators still have corresponding entries in Datashed, all mobile numbers up to date. Gateway passwords correct. Test messages from Datashed to DATRAN ok. |
| Alarms          | Alarm states consistent with pre migration. Test alarm generation and receipt.                                                                                                                                                 |
| Comms           | Server Serial ports configured and site comms operational or service like SMS Direct                                                                                                                                           |

## Further reading

* [Server requirements](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/server-requirements.md)
* [Backup, restart and disaster recovery](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/backup-and-restart.md)
* [Licensing](https://help.qtech.co.nz/datran/datran-vi-scada/datran-vi/licensing.md)
