Introduction
This guide explains how to convert a SQLite database into MySQL. This process is useful if you're migrating data from a Redmine instance using SQLite into an Easy8 environment using MySQL.
Target Audience
- Administrator
Prerequisites
Before you begin, make sure the following requirements are met:
- Easy8 is installed in a Linux environment
- Python is installed (tested with version 2.7.12)
- SQLite3 is installed (version 3.11.0 or similar)
- MySQL is installed
- You have access to both the original Redmine server and the new Easy8 server
- You have
sudoor root privileges
How to Convert SQLite to MySQL
Step 1: Dump the SQLite Database
On your current Redmine server:
- Create a dump of the SQLite database file:
sqlite3 db/redmine.sqlite3 .dump > redmine_dump.sqlite3 - Transfer the dump file (
redmine_dump.sqlite3) to the server where Easy8 is installed.
Step 2: Create a New MySQL Database
- Log in to MySQL:
mysql -u root -p - Create a new database for the converted data:
create database sqlite3_convert char set utf8mb4 row_format = dynamic; exit;
Step 3: Download the Conversion Script
- Download the conversion tool
sqlite3-to-mysql.pyto your Easy8 server. - Place it in a directory where you can easily access it.
Step 4: Run the Conversion
- Run the following command as
rootor usingsudo:sqlite3 redmine_dump.sqlite3 .dump | python sqlite3-to-mysql.py | mysql -u root -p sqlite3_convert - When prompted, enter your MySQL root password.
This process may take around 10 minutes, depending on the size of the database.
Conclusion
You have successfully converted your SQLite database to MySQL and imported it into a new database for use with Easy8. This migration step is useful when moving from a lightweight Redmine setup to a more robust Easy8 environment.
Related Topics and Further Reading
- Easy8 Documentation
- SQLite to MySQL conversion tools
- MySQL character set and storage engine configurations
