Switch from SQLite to MySQL as DBMS
Switching from SQLite to MySQL as a DBMS for storing the ispmanager 6 lite/pro/host panel database can be performed starting from version 6.79.0. Using SQLite is a convenient solution for small data volumes and low system load. However, in case ispmanager has a large number of users and receives a significant number of competitive queries, it is recommended to switch to MySQL DBMS.
Since version 6.79.0 of the ispmanager panel, you can select a database management system (DBMS) when installing the panel.
Database conversion from SQLite to MySQL can be performed using a special script. First, you need to download the script and run it using the following command:
wget https://download.ispmanager.com/tools/sqlite-to-mysql.sh && sh sqlite-to-mysql.shThe script performs the following actions:
- Installs MySQL and the SQLite console client if they have not been previously installed.
- Creates MySQL database and user for the ispmanager panel.
- Creates a
/usr/local/mgr5/etc/ispmgr.conf.d/db.confconfiguration file with connection data for the new MySQL database. - Creates table dumps from SQLite database and restarts ispmanager panel.
- The panel will automatically restore data from dumps to the new MySQL database.
The old SQLite database will not be deleted during conversion. To return to SQLite, delete the /usr/local/mgr5/etc/ispmgr.conf.d/db.conf file and restart the panel. The created data from MySQL will not be transferred to the SQLite database.
Possible problems and their solutions:
- "Convertation is not supported for ispmgrnode DB!" — This message means that the conversion script does not support working with the ispmanager business database. It is intended for ispmanager lite/pro/host only.
- "MySQL database 'ispmgr' already exist" — This indicates that the database named 'ispmgr' already exists in MySQL. In this case, you should delete it and try the conversion again.
- "Failed to create MySQL database" — If you cannot create a MySQL database, make sure that the MySQL server is running and that you can connect to it from the root console without using a password.
- "Failed to restore dump. Return to SQLite" — If an error occurs when restoring data from a dump, you need to contact ispmanager technical support and provide the logs of the requests that caused the error.