Description
Access Server includes a DB Convert feature to migrate the local SQLite3 database to an external MySQL database. This is useful in the following scenarios:
- Moving the local configuration (using SQLite3) to an external location (using MySQL) for centralized management, separate from the local virtual machine hosting Access Server.
- Changing the database backend from SQLite3 to MySQL.
- Sharing a single external MySQL database across multiple Access Servers nodes.
This article explains how to join a new Access Server (node 2) to an existing external MySQL database that is already being used by another Access Server (node 1).
Prerequisites
-
Access Server Requirements:
- A newly installed Access Server (node 2) using the same version as the existing Access Server (node 1).
- Console access and root privileges for node 2.
-
MySQL Database Requirements:
- An external MySQL database configured and accessible.
- MySQL server details:
- IP/Domain
- Username
- Password
- Port
Steps: Configure Access Server to use the external MySQL database
-
Connect to the new Access Server console and get root privileges.
- Stop openvpnas service:
service openvpnas stop
- Edit as.conf:
nano /usr/local/openvpn_as/etc/as.conf
- Look for the lines starting with config_db, user_prop_db, and certs_db.
- Comment out the current lines (SQLite-related) by adding a # at the start of each line, and add the MySQL database connection strings instead:
# certificates database
Replace the placeholders as follows:
# certs_db=sqlite:///~/db/certs.db
certs_db=mysql://<username>:<password>@<MySQL-Server-URL>:<port>/as_certs
# user properties DB
# user_prop_db=sqlite:///~/db/userprop.db
user_prop_db=mysql://<username>:<password>@<MySQL-Server-URL>:<port>/as_userprop
# configuration DB
# config_db=sqlite:///~/db/config.db
config_db=mysql://<username>:<password>@<MySQL-Server-URL>:<port>/as_config
username = MySQL database username
password = MySQL user password
MySQL-Server-URL = MySQL server IP address or domain name
port = MySQL server port (e.g., 3306 by default). -
Save and exit the file — ctrl+x, y, then enter.
- Start openvpnas service
service openvpnas start
After these steps, the new Access Server (node 2) will use the external MySQL database and share the same configuration as node 1.
If you have further questions, please submit a ticket.
Comments
0 comments
Please sign in to leave a comment.