Open topic with navigation

# Upgrade the Database Schema

Sometimes the schema of the Media Server database must change in order to provide new features or enhancements. If you are using an internal database, any schema changes are applied automatically. If you are using a database that is hosted on an external database server, you must run an upgrade script when you upgrade Media Server.

NOTE:

If you are using Image Server or Video Server 10.x with either an internal or external database, upgrade to Media Server 11.0 first, and then upgrade to the latest version.

Micro Focus provides scripts to upgrade to the latest version of the database schema from each of the earlier versions. The following table describes the schema changes for the Media Server database.

Schema version | Media Server version | Script to run to upgrade to latest schema
--- | --- | ---
5 | 11.4 | You are using the latest database schema
4 | 11.2 | `mysql-upgrade_from_v4.sql` (for MYSQL databases) `postgres-upgrade_from_v4.sql` (for PostgreSQL databases)
3 | 11.0 | `mysql-upgrade_from_v3.sql` (for MYSQL databases) `postgres-upgrade_from_v3.sql` (for PostgreSQL databases)

Running one of these scripts copies your training data and adds it to the database using the latest schema. These scripts do not remove training data stored using earlier schema versions. This means that you can continue to use the database with an earlier version of Media Server. Be aware that if you use multiple versions of Media Server, any new training you perform is only added to the database using the schema for the Media Server that performs the training. For example, if you upgrade from schema version 3 to schema version 4, you can perform training with Media Server 11.0.x and Media Server 11.2.x. However, any training you perform with Media Server 11.2.x is available only to Media Server version 11.2.x, and any training that you perform using Media Server 11.0.x is available only to Media Server version 11.0.x.

After a successful schema upgrade you can remove data stored using earlier schema versions. This saves storage space on the database server. Micro Focus provides scripts to remove the data, named `mysql-purge_before_vX.sql` (for MySQL databases) or `postgres-purge_before_vX.sql` (for PostgreSQL databases), where `X` is the oldest schema version you want to retain in the database. For example, if you upgrade from schema version 3 to schema version 4, and do not want to use Media Server versions earlier than 11.2.x again, you can run `mysql-purge_before_v4.sql` or `postgres-purge_before_v4.sql` to remove schema version 3 and earlier from the database.

To upgrade the database schema

1. In the table above, find the version of Media Server that you are upgrading from.

2. Run the corresponding upgrade script for your database, using the same command syntax as used to create the database (see the following topics):

   - Set Up a PostgreSQL Database on Windows
   - Set Up a PostgreSQL Database on Linux
   - Set Up a MySQL Database on Windows
   - Set Up a MySQL Database on Linux
   NOTE:

   Run the upgrade script using the `psql` command-line tool (for PostgreSQL databases) or the `mysql` command-line tool (for MySQL databases). The script contains instructions that are only supported when the script runs through these tools.

3. Start Media Server 11.6, and run training and analysis as normal.
4. (Optional) When you have confirmed that the upgrade was successful, remove the training data stored using earlier schema versions by running the relevant script, either `mysql-purge_before_vX.sql`, or `postgres-purge_before_vX.sql`, where `X` is the oldest schema version you want to retain in the database.

© 2018 EntIT Software LLC, a Micro Focus company | Send documentation feedback to Micro Focus Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm