This project merges tables from two MySQL databases (lims and labbench) into a combined database (lims_merge).
- Java 11 or later
Verify with:java -version
- Maven 3.6+
Verify with:mvn -v
- Access to the MySQL servers for
lims,labbench, and the merge target (lims_merge).
-
Clone the repository
git clone <repo_url> cd merge_lims
-
Configure environment variables
Copy the example.envfile and fill in your connection details:cp env.example .env
Example
.env:SRC_HOST=127.0.0.1 SRC_PORT=your_port SRC_USER=your_username SRC_PASS=your_password SRC_SCHEMA=lims DST_HOST=<do_host> DST_PORT=<do_port> DST_USER=<do_user> DST_PASS=<do_password> DST_SCHEMA=lims_merge
-
Ensure the merge schema exists
If needed, create the destination schema from the LIMS schema:mysql -h <MERGE_HOST> -P <MERGE_PORT> -u <MERGE_USER> -p --ssl-mode=REQUIRED -e "CREATE DATABASE IF NOT EXISTS lims_merge;"
Compile the project with Maven:
mvn clean packageThis produces:
target/merge-subset-1.0-SNAPSHOT.jar
Execute the merge:
java -jar target/merge-subset-1.0-SNAPSHOT.jarThe tool will:
- Connect to both source databases (
limsandlabbench). - Copy shared/global tables to the merge schema.
- Merge plate-level data according to project logic.
- You must have read access to
limsandlabbenchschemas and write access to themergeschema. - Use
--no-datadumps to clone structure if the merge schema is missing. - Errors like “table doesn’t exist” usually mean you haven’t created the target schema.