Migrating or Overwriting an Existing MES Database
- Last UpdatedMay 01, 2023
- 5 minute read
If you are upgrading MES and there is an existing MES database, you have the following options:
-
Migrate the existing database to the new MES version.
-
Overwrite the existing database with a new MES database.
-
Keep the existing database and not run the MES Database Setup configuration. Note that this option leaves the database unusable, as the current version of MES will not work with a previous version of the database.
To migrate or overwrite an existing MES database
-
Complete the database server and MES database name settings:
Server Name
The name of the server that is hosting the existing MES database. The server name defaults to the local server. Supported server names include IP names (IPv4 and IPv6), SQL server named instance conventions, cluster names, and SQL Server Availability Groups.
When using a Failover or Availability Group naming convention, the configuration must be performed when the primary node is active.
Database Name
The name of the existing MES database. The name defaults to the existing database, if one is found.
-
Specify the user account to use to access SQL Server.
For more information, see Specifying SQL Server User Authentication.
For the Database Setup component, the user account provided must have adequate rights on SQL Server to create a database.
-
To check that the user account you have specified can access the specified SQL server and MES database, click Validate.
As part of the validation, as estimate is calculated for how long upgrading the existing database will take. If the estimate is more than 10 minutes, the estimated time is displayed in a message box.

If the validation is successful, the Existing Database settings appear.

If the specified database is not found, then the settings for creating a new database appear. Try entering the correct name for the existing database and clicking the Validate button again.
-
Do one of the following:
-
To migrate the existing database to the new release, select the Overwrite and Migrate data options. Then go to step 6.
-
To overwrite the existing database with a new MES database, select the Overwrite option but clear the Migrate data option. Then go to step 5.
When the Overwrite option is selected and the Migrate data option is cleared, the Advanced settings title appears with the settings collapsed.
-
To keep the existing database and not run the Database Setup configuration, select the Keep option.
Note: If you choose to overwrite or migrate the existing MES database, it is strongly recommended that you back up the existing database before proceeding in case you need to recover its content. You can back up the database from SQL Server Management Studio.
-
-
Optionally, to set the path, initial size, or percentage growth of either the new MES database's data file or log file, click the Advanced settings title to expand the settings and enter them. Then go to step 7.

Path
The path of the data or log file.
Initial Size
The initial size, in MB, of the data or log file.
Percent growth
The percent by which to limit the percent growth of the data or log file.
-
If the existing MES database that you are migrating has the system parameters for recording distinct production records set but instead you want to aggregate these records into hourly records and disable distinct production records, select the Aggregate existing item production records option.
If the existing MES database already has the system parameters for recording distinct production records set to False, then the setting of this option has no effect.
It is recommended to aggregate production records into hourly buckets, as this will improve the overall system performance for recording production and reporting on production data. In versions prior to MES version 4.5, recording distinct production records was required for reporting hourly KPIs, but this is no longer the case. You might still want distinct production records for other reasons, in which case do not select this option.
-
To migrate or overwrite the existing MES database, click Configure.
CAUTION: While the database is being migrated from a prior version, the Configurator application cannot be closed or switched to a different component's configuration. If the Configurator application is stopped prematurely (such as closing the application or shutting down the computer), the MES database will be in an inconsistent state and might not function correctly.
The SQL scripts that migrate or create the database run. A message appears, asking to wait while the database configuration is performed.

Progress information and any error messages appear in the Configuration Messages box.
If the database migration or creation completes successfully, a success message appears in the Configuration Messages box. Also, the MES Database Setup status indicator changes to a green check mark.
During migration, if the database is configured to use OS Group security and does not already have the OS Group SIDs in the MES database, the configure operation will attempt to create them. If the domain is not available, then use the OS Group SID Utility to update them later when the domain is available. See Importing Windows Active Directory Group SIDs into the MES Database.
If migrating from MES 2014 R3 (version 5.3) or earlier, the migration process creates new tables for tracking utilization data and moves the existing data into these new tables. The original tables still remain in the database but have been renamed to util_log_deprecated, job_util_log_link_deprecated, and tpm_stat_deprecated. These deprecated tables can be deleted once the migration is deemed to have completed successfully. New views are created with the original table names of util_log, job_util_log_link, and tpm_stat to ensure any existing queries or reports continue to function after migration.