Skip to content

Latest commit

 

History

History
105 lines (66 loc) · 3.75 KB

README.md

File metadata and controls

105 lines (66 loc) · 3.75 KB

Transformo: a tool for data transformation using SPL techniques

Transformo is a framework used as the basis for David Romero's Ph.D. thesis. Transformo is a framework with which you can perform migrations between relational databases using software product lines, obtaining custom SQL scripts compatible with each other.

1. Development Environment

1.1 Clone repo

git clone https://github.com/diverso-lab/transformo
cd transformo

1.2 Activate virtual environment

python -m venv venv
source venv/bin/activate

1.3. Install dependencies

pip install -r requirements.txt

1.4 Generating transformation scripts

All valid products of the transformation feature model can be generated by executing:

python test_application_engineering.py

These scripts are stored in the folder workspaces/DW2/scripts.

2. Validation Environment (Drupal MySQL -> WordPress MySQL)

In this section we detail how to generate a Drupal instance with sample data as source system and an empty WordPress instance as target system to validate the migration functionality of the Transformo framework.

2.1 Deployment with Docker

We move to dp-to-wp

cd dp-to-wp

Now, we must deploy our Drupal and WordPress instances with Docker (one step at a time, in the order shown). First, we deploy our Drupal services:

make prepare_drupal
make install_drupal

The following commands will start our WordPress instances:

make prepare_wordpress
make install_wordpress

Thus, we have started a Drupal container populated with test data on port :8080 and a PHPMyAdmin instance on :8081, which will represent our source system. We have also started a configured and empty WordPress instance to represent our target, on port :8083 and its PHPMyAdmin on port :8084.

Web MySQL PHPMyAdmin Credentials (Web /admin & PHPMyAdmin database access)
Drupal :8080 :33061 :8081 user=drupal, password=drupal
WordPress :8082 :33062 :8083 user=wordpress, password=wordpress

If you have already installed both Drupal and Wordpress, you can execute the following commands to up or down the corresponding containers:

make up
make down

2.2 Testing transformation scripts

To test the scripts, we must have both Drupal and WordPress up.

2.2.1 Environment setup

Since a SQL script only allows movements between databases within the same server, we are forced (at least for the moment) to download the Drupal database and import it into the WordPress MySQL container.

First, we access the Drupal phpMyAdmin in localhost:8081, with the credentials drupal:drupal. We go to Export and choose the Quick option.

Once done, we now go to the Drupal phpMyAdmin in localhost:8083 with the credentials root:woordpress. We create a database called drupal, hit Import and import our drupal.sql.

We are ready!

2.2.2 Target database setup

We have prepared a script that disables NULL and AUTOINCREMENT constraints. Since our validation focuses on dumping field by field from one database to another, it is important that the target database has no restrictions on individually updated fields.

Therefore, in the SQL tab, we execute the code contained in workspaces/DW2/scripts/prepare.sql:

2.2.3 Execute transformation scripts!

We can run any of the scripts located in the folder workspaces/DW2/scripts. Remember that the execution of each script alters the original WordPress data, so it is necessary to run prepare.sql again BEFORE each script. Otherwise, it will not work because MySQL will detect repeated keys.