[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] MariaDB / MySQL
[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.
[en] To add new database replacements, open Control Center and go to Administration > Database Replacements.
[en] Click Add+. The Database replacements page opens.
[en] Type the Replacement name. Make the name descriptive so you can easily find the replacement later.
[en] The Find text field lets you search for the existing
Fromelement of the replacement pair. This is the database connection string you are replacing.
[en] Type Replace with. This is the
<To>element of the replacement pair. This is your final database connection string.
[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
myDatabase. You want to update your database connection string to use the database
NEW_myDatabase on the server
[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:
[en] 3. Type in the Replace with field:
[en] 4. Add the second replacement and name it Database name replacement.
[en] 5. Type in the Find text field:
[en] 6. Type in the Replace with field:
[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.