[en] Database Replacements

Official translation unavailable. Translate this page with Google:
NLCEssentials_NCBussines_NCCompliance_LMSPro_LMSEnterprise

[en] Database replacement lets you change database connections for your labels, solutions, and Automation configurations when switching between multiple database servers.

[en] Database replacements enable you to configure solutions in development environments and run those solutions in production environments without any database configuration changes inside the solutions.

注意

[en] To configure database replacements, you must log on to Control Center as an Administrator.

[en] Database connection string replacements let you configure solutions where parts of database connection strings change while solutions run with connected databases. After running database connection string replacements, your solution still uses the unchanged database configuration, but with a connection to a different database server.

[en] You can use the database replacement option with all types of databases:

  • [en] SQL

  • [en] Oracle

  • [en] MariaDB / MySQL

  • [en] Access

  • [en] Excel

  • [en] CSV and other text files

注意

[en] Database replacement is possible with solutions and configurations that run in NiceLabel Print, NiceLabel Web Client, and Automation.

[en] Configuring database replacements define your "from-to" replacement pairs. Each replacement pair contains Value from and Value to elements. During actions, Value from strings becomes Value to strings. The number of replacement pairs is not limited.

  1. [en] To add new database replacements, open Control Center and go to Administration > Database Replacements.

  2. [en] Click Add+. The Database replacements page opens.

  3. [en] Type the Replacement name. Make the name descriptive so you can easily find the replacement later.

  4. [en] The Find text field lets you search for the existing From element of the replacement pair. This is the database connection string you are replacing.

  5. [en] Type Replace with. This is the <To> element of the replacement pair. This is your final database connection string.

  6. [en] Click Save. Your new replacement is active and listed on the Data replacement page.

注意

[en] After you click Save, database replacements require up to 10 minutes to take effect.

例 27. [en] Example

[en] Your action in Automation connects to mySQLServer and myDatabase. You want to update your database connection string to use the database NEW_myDatabase on the server NEW_mySQLServer.

[en] You must define two replacements – the first changes the server name, and the second changes the database name.

[en] 1. Add the first replacement and name it Server name replacement.

[en] 2. Type in the Find text field: Data Source=mySQLServer

[en] 3. Type in the Replace with field: Data Source=NEW_mySQLServer

[en] 4. Add the second replacement and name it Database name replacement.

[en] 5. Type in the Find text field: Initial Catalog=myDatabase

[en] 6. Type in the Replace with field: Initial Catalog=NEW_myDatabase


注意

[en] All database replacements are encrypted in the Control Center database. This ensures the secure replacement of sensitive data, such as user names, passwords, and network addresses.

[en] Database replacement ensures that your solutions and configurations connect to the right databases both in a test environment and in production.