Database Schema Initiation
When the Xillio Link Redirector is configured to use a SQL database, it is necessary to create the database schema before use. Otherwise the application will not be able to read and story any data.
To create the database schema, you need to run the application with the XLR_DANGEROUS_SYNCHRONIZE
-environment variable set to true
. This will enable the synchronization of the database schema.
It is important to note that keeping the XLR_DANGEROUS_SYNCHRONIZE
-variable set to true
allows the application to overwrite the database schema on every restart. This poses a risk of data loss and is not recommended for production environments.
Step 1. Update your environment variables
- Windows
- Linux
- Docker Compose
In order to add the environment variable on Windows, you can take the following steps:
- Press
Windows Key
+X
to open the Power User Task Menu, or right click on the windows icon in the toolbar in the bottom of your screen. - In the Power User Task Menu select the System option.
- In the System > About window, click the Advanced system settings link below the Device specifications section.
- In the System Properties window, click the Advanced tab,if not already selected.
- Click the Environment Variables-button near the bottom-right of the Advanced tab.
- In the environment editor click on the new-button in the System Variables settings
- In the New System Variable window, enter
XLR_DANGEROUS_SYNCHRONIZE
as the variable name andtrue
as the variable value.
To update the environment variables on Linux, you can use the following command (dont close the terminal after running the command):
export XLR_DANGEROUS_SYNCHRONIZE=true
If you are using Docker Compose, you can update the docker-compose.yml
file by adding the following environment variable to the xlr
-service:
# ...
xlr:
image: xillio/link-redirector:latest
restart: always
environment:
XLR_DANGEROUS_SYNCHRONIZE: true
ports:
- 80:80
- 443:443
- 8080:8080
- 8443:8443
volumes:
- ./certs:/app/certs
- ./config.yml:/app/config.yml
# ...
Step 2. Restart the application
After updating the environment variables, the application needs to be restarted in order to synchronize the database schema. You can do this by following the steps below:
- Windows
- Linux
- Docker Compose
Stop the application by pressing CTRL
+ C
in the terminal where the application is running. After the application has stopped, you can start it again by running the following command:
./bin/xill4.exe
Stop the application by pressing CTRL
+ C
in the terminal where the application is running. After the application has stopped, you can start it again by running the following command:
./bin/xill4
Restart the xlr
-service by running the following command:
docker-compose restart xlr
Step 3. Remove the environment variable
After the application has successfully started, it is advisable to remove the XLR_DANGEROUS_SYNCHRONIZE
-variable from the docker-compose.yml
-file to prevent any unintended changes.