Home > Resources > Software: Digital Signage > BRAVIA Signage > Advanced User Guide

2. Advanced usage (for Infrastructure)

Estimated reading time: 9 minutes

This chapter describes the procedures for the operation and management of system infrastructure, such as DB backup, the customization of system architecture, etc.

2.1. How to back up and restore the database

Back up the database used by this software.

For BRAVIA Signage Server 1.8.4 or earlier

This software uses a MongoDB as database software. Backup of this software is executed by backup methods of MongoDB. There are two methods of back up.

Copying underlying files

It’s easy and fast, but you need to stop BRAVIA Signage Server while backing up.

[Backup]

[1] Open [Control Panel] [Security and System] [Administrative Tools], then open [Services].

[2] Select “BRAVIA Signage Server”, then right-click and select [Stop] in the [Services] window.

[3] Select “MongoDB”, then right-click and select [Stop] in the [Services] window.

[4] Copy the “C:\data\db” directory to any path as backup.

[5] Select “MongoDB”, then right-click and select [Start] in the [Services] window.

[6] Select “BRAVIA Signage Server”, then right-click and select [Start] in the [Services] window.

[Restore]

[1] Execute steps [1] to [3] of “Backup”.

[2] Delete the “C:\data\db” directory.

[3] Copy a backup directory to “C:\data\db”.

[4] Execute steps [5] and [6] of “Backup”.

Backup by using mongodump

You can back up while BRAVIA Signage Server is running, but much time is required to back up and restore. A sufficient PC spec is required when you back up while BRAVIA Signage Server is running because it requires many database accesses.

[Backup]

[1] Run a command prompt with Administrative Privileges. Right-click the mouse button on the start menu and select the [Run as administrator] option from the Power User menu.

Run all of the following commands in Command Prompt with Administrative Privileges.

[2] Run the following command for backup. Specify any path for a backup file.

  "C:\Program Files\MongoDB\Server\3.0\bin\mongodump.exe" --out "D:\mongo-backup"

[Restore]

[1] Execute the procedure [1] to [3] at “Backup” in “Copying underlying files”.

[2] Delete the “C:\data\db” directory.

[3] Run the following command to create directories where database files will be saved.

  mkdir C:\data\db

[4] Select “MongoDB”, then right-click and select [Start] in the [Services] window.

[5] Run the following command to restore. Specify the backed up file.

  "C:\Program Files\MongoDB\Server\3.0\bin\mongorestore.exe" "D:\mongo-backup"

[6] Select “BRAVIA Signage Server”, then right-click and select [Start] in the [Services] window.

You can also use MMS (MongoDB Management Service). Refer to the official MongoDB web site on how to use MMS. Back up the database and restore with “Administrative Privileges”.

For BRAVIA Signage Server 2.0.0 or later

This software uses a PostgreSQL as database software. Backup of this software is executed by backup methods of MongoDB. There are two methods of back up.

Copying underlying files

It’s easy and fast, but you need to stop BRAVIA Signage Server while backing up.

[Backup]

[1] Open [Control Panel] [Security and System] [Administrative Tools], then open [Services].

[2] Select “BRAVIA Signage Server”, then right-click and select [Stop] in the [Services] window.

[3] Select “postgresql-x64-{version}”, then right-click and select [Stop] in the [Services] window.

[4] Copy the “C:\data\postgresql” directory to any path as backup.

[5] Select “postgresql-x64-{version}”, then right-click and select [Start] in the [Services] window.

[6] Select “BRAVIA Signage Server”, then right-click and select [Start] in the [Services] window.

[Restore]

[1] Execute steps [1] to [3] of “Backup”.

[2] Delete the “C:\data\postgresql” directory.

[3] Copy a backup directory to “C:\data\postgresql”.

[4] Execute steps [5] and [6] of “Backup”.

Backup by using pg_dump

You can back up while BRAVIA Signage Server is running, but much time is required to back up and restore. A sufficient PC spec is required when you back up while BRAVIA Signage Server is running because it requires many database accesses.

[Backup]

[1] Run a command prompt with Administrative Privileges. Right-click the mouse button on the start menu and select the [Run as administrator] option from the Power User menu.

Run all of the following commands in Command Prompt with Administrative Privileges.

[2] Run the following command for backup. Specify any path for a backup file.

 cd "C:\Program Files\PostgreSQL\17\bin"
  pg_dump bravia_signage -U bs1 > postgresql-backup.sql"

[Restore]

[1] Open [Control Panel] [Security and System] [Administrative Tools], then open [Services].

[2] Select “BRAVIA Signage Server”, then right-click and select [Stop] in the [Services] window.

[3] Run the following command in the Command Prompt to restore the backup data.

 cd "C:\Program Files\PostgreSQL\17\bin"
  psql -X bravia_signage -U bs1 < postgresql-backup.sql

[6] Select “BRAVIA Signage Server”, then right-click and select [Start] in the [Services] window.

2.2. How to migrate the server

The following steps show how to run the BRAVIA Signage Server on other server PC with the existing data.

[1] Back up the database on the source server. Refer to 2.1. How to back up and restore the database on how to backup.

[2] Install the BRAVIA Signage Server on the destination server. Refer to “BRAVIA Signage User Guide” on how to install the server.

[3] Restore the database on the destination server. Refer to 2.1. How to back up and restore the database on how to backup.

2.3. How to operate MongoDB with a separate server PC

The following steps show how to separate PCs that the BRAVIA Signage Server and database software run on.

[1] Install BRAVIA Signage Server and the database software (*1) on separate server PCs. For details on how to install BRAVIA Signage Server, refer to the “BRAVIA Signage User Guide”. For details on how to install the database software, refer to the information on the official website for the software.

(*1) BRAVIA Signage Server 1.8.4 and earlier uses MongoDB, and BRAVIA Signage Server 2.0.0 and later uses PostgreSQL.

[2] Run a command prompt with Administrative Privileges. Right-click the mouse button on the start menu and select the [Run as administrator] option from the Power User menu.

[3] Run the following command to stop the BRAVIA Signage Server.

  cd "c:\Program Files (x86)\SONY\BRAVIA Signage"
  braviasignageserver.exe stop

[4] To connect to a database on a separate server PC, modify the “braviasignageserver.xml” file.

  • For BRAVIA Signage Server 1.8.4 or earlier

Run any text editor with Administrative Privileges, open “c:\Program Files (x86)\SONY\BRAVIA Signage\braviasignageserver.xml”, edit with the following procedures and save it. Refer to 1.2. How to run multiple services of the BRAVIA Signage Server for XML tag definitions. The following example shows a case where the Server IP address MongoDB runs on is “192.168.10.10”.

  <service>
    <id>braviasignageserver.exe</id>
    <name>BRAVIA Signage Server</name>
    <description>BRAVIA Signage Server</description>
    <executable>%BASE%\node.exe</executable>
    <arguments>--harmony "%BASE%\node_modules\node-windows\lib\wrapper.js" -f "%BASE%\server\app.js" -l "BRAVIA Signage Server" -g 0.25 -w 1 -r 3 -a n</arguments>
    <logmode>reset</logmode>
    <startmode>Automatic</startmode>
    <env name="NODE_ENV" value="production"/>
    <env name="PORT" value="50000"/>
    <env name="MONGO_URI" value="mongodb://192.168.10.10/braviasignage"/>
  </service>
  • For BRAVIA Signage Server 2.0.0 or later

Run any text editing software as an administrator, open “c:\Program Files (x86)\SONY\BRAVIA Signage\braviasignageserver.xml”, and add the tag specifying PostgreSQL as shown in the example below. Save the file after making the change. In the example below, the IP address of the server PC where PostgreSQL is installed is “192.168.10.10” and the PORT number is “5432”.

In addition, you need to specify the superuser password that was configured when PostgreSQL was installed and the public key encrypted password for the BRAVIA Signage user. In the example below, the encrypted passwords are specified for “POSTGRESQL_SU_PASSWORD” and “POSTGRESQL_BS1_PASSWORD”.

Password encryption (PowerShell)
Replace the password (written as “password”) in the command below.

> $publicCertPath = "C:\Users\{username}\AppData\Local\bravia-signage\bs1.cer"
> $publicCert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
> $publicCert.Import($publicCertPath)
> $publicKey = $publicCert.PublicKey.Key
> $password = "password"
> $bytesToEncrypt = [System.Text.Encoding]::UTF8.GetBytes($password)
> $encryptedBytes = $publicKey.Encrypt($bytesToEncrypt, [System.Security.Cryptography.RSAEncryptionPadding]::Pkcs1)
> $encryptedPassword = [Convert]::ToBase64String($encryptedBytes)
> Write-Host "Encrypted Password: $encryptedPassword"
Encrypted Password: jv87qCwhEp5kpNHJxwKSHkdRwihnWk/1VQ5Fv+piZNs4JvCoY6DwF5bg7psfJzTl8ai6j2q3FjmEspIDs7Wu7EFnskHAPiEBr8IDNUhis1fk4s6b5/OOHmeI2r5yflqKsmbKCU1EOyTIzEgElCa6k+AIfmZVA+lY6++4pIquX+tlVvUdDRU5QCJkkgEYsuK3/KNHZbg5zLGVLQuoZy3Z5aM1zpdKw0JYH1QibYjUjet73bhkFFXhEs6JR9Ky34kov8g21wKZEyWPhsK1ZIdH5Y3TKtuDCisdsDpgohLcogu25mQI/b/mNizx9mwY14b/M9Marrrq+I/2c/Kp7SpeVg==

Specify the superuser and BRAVIA Signage user encrypted by the above command.

<service>
  <id>braviasignageserver.exe</id>
  <name>BRAVIA Signage Server</name>
  <description>BRAVIA Signage Server</description>
  <executable>%BASE%\app.exe</executable>
  <arguments>--max_old_space_size=2000 -- -f "%BASE%\server\app.js" -l "BRAVIA Signage Server" -g 0.25 -w 1 -r 3 -a n</arguments>
  <logmode>reset</logmode>
  <startmode>Automatic</startmode>
  <logpath>C:\Users\{username}\AppData\Local\bravia-signage\logs</logpath>
  <env name="NODE_ENV" value="production" />
  <env name="POSTGRESQL_SU_PASSWORD" value="jv87qCwhEp5kpNHJxwKSHkdRwihnWk/1VQ5Fv+piZNs4JvCoY6DwF5bg7psfJzTl8ai6j2q3FjmEspIDs7Wu7EFnskHAPiEBr8IDNUhis1fk4s6b5/OOHmeI2r5yflqKsmbKCU1EOyTIzEgElCa6k+AIfmZVA+lY6++4pIquX+tlVvUdDRU5QCJkkgEYsuK3/KNHZbg5zLGVLQuoZy3Z5aM1zpdKw0JYH1QibYjUjet73bhkFFXhEs6JR9Ky34kov8g21wKZEyWPhsK1ZIdH5Y3TKtuDCisdsDpgohLcogu25mQI/b/mNizx9mwY14b/M9Marrrq+I/2c/Kp7SpeVg==" />
  <env name="POSTGRESQL_BS1_PASSWORD" value="A1S9x4iQ0LmDYgIbbbLiLPiwyc0Una2s9Fk6IMUPcyxUyFYTRnRZdae9ieFHx4TJXc8HiUXAcpXv2FidFiE3A4wFw12nTZFazeprIzMpmsIhPgwLCtfT//jngEIV8gvBHCr6nvHd24HV7nUVJeyf7Xhjr5GMkhXo1RBxRAn0+CfmvXZ9A/eC2/0CLKZxXEOYaDC44XvLY4mOZ+2GjGyl8u3Hh5F4FcsmQPbm8xMYqrYImDjAEDrOu11xiBYG3wsvS9OvdluuxBq1toUi6P/a6aeKzl5l1Lj7Qy0rBvmUqWjTNILg6k3//gSY6YALleUIjRhPQW6/tgOnCH+zHz3cug==" />
  <env name="PORT" value="50000"/>
  <env name="POSTGRESQL_HOST" value="192.168.10.10">
  <env name="POSTGRESQL_PORT" value="5432">
</service>

[5] Run the following command to restart the BRAVIA Signage Server.

  cd "c:\\Program Files (x86)\\SONY\\BRAVIA Signage"
  braviasignageserver.exe start

2.4. Reverse Proxy Server configurations

BRAVIA Signage Server communicates with BRAVIA Signage Player and a browser (Operation Web Application) on the client PC. You can insert the reverse proxy server between these. This section describes the configuration.

Configuration for BRAVIA Signage

[1] config.txt of BRAVIA Signage Player

The “server” key must NOT be the URL of BRAVIA Signage Server. It MUST BE the URL of the reverse proxy server. The directory name can also be included in the URL specified in the “server” key of config.txt For example, “http://192.169.10.10:50000/dir1/dir2” can be specified in the “server” key.

Configuration for reverse proxy server

[2] Communication between BRAVIA Signage Player and Reverse Proxy Server

BRAVIA Signage Player accesses the URL starting with “/socket.io-player/” in the communication with BRAVIA Signage Server. Configure the proxy pass of the reverse proxy server to “http://{server-ip:service-port}/socket.io-player/”. {server-ip:service-port} indicates the server IP address which BRAVIA Signage Server runs on and the BRAVIA Signage Server port number.

[3] Communication between Operation Web Application and Reverse Proxy Server

Operation Web Application accesses the URL starting with “/” in the communication with BRAVIA Signage Server. Configure the proxy pass of the reverse proxy server to “http://{server-ip:service-port}/”.