Database replacement lets you change database connections for your labels, solutions, and Automation configurations when switching between multiple database servers.
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.
To configure database replacements, you must log on to Control Center as an Administrator.
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.
You can use the database replacement option with all types of databases:
MariaDB / MySQL
CSV and other text files
Database replacement is possible with solutions and configurations that run in NiceLabel Print, NiceLabel Web Client, and Automation.
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.
To add new database replacements, open Control Center and go to Administration > Database Replacements.
Click Add+. The Database replacements page opens.
Type the Replacement name. Make the name descriptive so you can easily find the replacement later.
The Find text field lets you search for the existing
Fromelement of the replacement pair. This is the database connection string you are replacing.
Type Replace with. This is the
<To>element of the replacement pair. This is your final database connection string.
Click Save. Your new replacement is active and listed on the Data replacement page.
After you click Save, database replacements require up to 10 minutes to take effect.
Example 25. Example
Your action in Automation connects to
myDatabase. You want to update your database connection string to use the database
NEW_myDatabase on the server
You must define two replacements – the first changes the server name, and the second changes the database name.
1. Add the first replacement and name it Server name replacement.
2. Type in the Find text field:
3. Type in the Replace with field:
4. Add the second replacement and name it Database name replacement.
5. Type in the Find text field:
6. Type in the Replace with field:
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.
Database replacement ensures that your solutions and configurations connect to the right databases both in a test environment and in production.