Backup
On each computer running Server processes, copy:
- the whole
%ProgramData%\Telecontrol\SCADA Serverfolder — each process has its own folder in it, holding its parameter file, databases and logs, and the license filelicense.jsonsits beside them; - the
C:\Program Files\Telecontrol SCADA\data\Certificatesfolder — the Server certificate and its private key, and on the central computer thecasubfolder as well — the site certificate authority with itsca_key.pemkey. Without it every other computer must join again after a restore (see A new certificate authority). Keep the copy of the keys as safe as the passwords.
On Linux copy the whole /var/lib/scada folder and the
/opt/telecontrol-scada/data/Certificates folder, with the processes
stopped by sudo /opt/telecontrol-scada/bin/scada-setup stop.
/var/lib/scada also holds the password file
secrets/service-secrets.env, which keeps the svc and root passwords
in plain text: keep the copy where only root can read it, or leave
that file out. The services do not start without it, and start does not
create it: if the copy has no secrets folder, keep the existing one when
restoring, or run apply with the passwords instead of start (see
Restore).
Copy only with this computer’s processes stopped: a copy of the files of running databases may be inconsistent. From an elevated command prompt:
"C:\Program Files\Telecontrol SCADA\bin\scada-setup.exe" stop
rem copy %ProgramData%\Telecontrol\SCADA Server
rem and C:\Program Files\Telecontrol SCADA\data\Certificates
"C:\Program Files\Telecontrol SCADA\bin\scada-setup.exe" start --tiers <this computer's processes>
A restore also needs the svc password, the root password, and the
computer’s parameters — the --tiers, --central,
--advertise, --license, the central computer’s fingerprint and the other
options, if given, that scada-setup apply was run with on it. Some of them
are in the copied parameter files of the processes, and on Linux the copy
also holds secrets/service-secrets.env with the passwords, but the backup
does not give them in a form apply can reuse — keep the written record of
the options and passwords separately.
Configuration backup
The configuration is an SQLite database in the config\Configuration folder
of scada-config; the other processes read it from there. The
filestore\Configuration folder holds only the svc service account.
For PostgreSQL, use the standard PostgreSQL backup tools such as
pg_dump.
History backup
The historical databases are in historian\History, and the schematic files
in filestore\FileSystem.
Versions 2.5 and earlier kept this data in the Configuration, History and
FileSystem folders directly under %ProgramData%\Telecontrol\SCADA Server.
After upgrading from version 2.5 those folders stay where they
are, but the 2.6 processes no longer use them.
Restore
Run the scada-setup commands by their full path from an elevated command
prompt.
On the same computer:
- Stop the processes:
scada-setup stop. - Put the
%ProgramData%\Telecontrol\SCADA Serverfolder (and theCertificatesfolder, if it is gone, then restrict access to the key file with theicaclscommand given below in step 3 for a new computer) back from the backup. - Run
scada-setup applywith the same computer’s parameters and thesvcandrootpasswords (see Re-running apply). The restored folder takes the permissions of%ProgramData%, which let any user of the computer read it;applycloses it to other users again and starts the services, whilescada-setup startdoes not. - Check the result:
scada-setup status.
On a new or rebuilt computer:
- Install the package of the same version as the backup.
- Put the
%ProgramData%\Telecontrol\SCADA Serverfolder back from the backup. -
If the computer’s name is the same, put the
C:\Program Files\Telecontrol SCADA\data\Certificatesfolder back too, then restrict access to the key file (a copied file takes the folder’s permissions):icacls "C:\Program Files\Telecontrol SCADA\data\Certificates\ServerPrivateKey.pem" /inheritance:r /grant:r *S-1-5-18:F *S-1-5-32-544:FIf the computer’s name is different, do not put
ServerCertificate.pemandServerPrivateKey.pemback from theCertificatesfolder (or delete them): the old certificate names the former computer name, andapplycreates a new pair only when neither of the two files exists. Put the central computer’scasubfolder back in any case — otherwiseapplycreates a new certificate authority and the other computers have to join again (see A new certificate authority). On a computer withoutscada-config, giveapplyin step 4--central-fingerprinttoo, to get a new certificate from the certificate authority. Take the fingerprint fromscada-setup statuson the central computer now, not from the recorded parameters: it differs once the central computer’s certificate has been renewed. - Run
scada-setup applywith the same computer’s parameters as before, the samesvcpassword, and therootpassword. Thesvcpassword is stored in the restored databases, and with a different one the processes cannot connect to each other.applyregisters and starts the services, and keeps the restored databases and certificate. If the site’s other computers name this one in--centralby an address that has changed, runapplythere with the new address. If this computer runs protocol processes, was set up with--advertiseand its address changed, give--advertisethe new address. - Create the inbound firewall rules again — the backup does not contain
them (see
Network preparation).
If the address of this computer changed, also correct the
remoteiplists of the rules on the site’s other Server computers. - If this is the central computer and its address or name changed, enter
the new one in the
Serverfield of the login dialog of each Client (see Client login). - Check the result:
scada-setup status.
With a new certificate, third-party OPC UA clients that trusted the old one have to be set up again.
On Linux the folders are the ones in Backup —
/var/lib/scada and /opt/telecontrol-scada/data/Certificates — and the
commands are sudo /opt/telecontrol-scada/bin/scada-setup …; the icacls
step is not needed. Files put back as root (with cp -r, say) belong to
root, but scada-setup start gives them back to the scada account and
closes the process folders to other users again before it starts the
services, so on the same computer scada-setup start is enough instead of
step 3
while the secrets folder is in place (otherwise run apply with the
passwords); on
a new computer run apply as in the steps above (“On a new or rebuilt
computer”). If start reports that the scada account does not exist, the
system was reinstalled — restore with the new-computer steps.