Coder Social home page Coder Social logo

diverso-lab / transformo Goto Github PK

View Code? Open in Web Editor NEW
0.0 4.0 0.0 207 KB

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.

Python 98.35% Makefile 0.67% Jinja 0.99%

transformo's Introduction

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.

transformo's People

Contributors

drorganvidez avatar joszamama avatar

Watchers

José A. avatar José Miguel Horcas avatar David Benavides avatar  avatar

transformo's Issues

Fix ports in wordpress mysql container

You have to include the following code into docker-compose in auto-wp repository

  mysql:
    image: mysql:${MARIADB_VERSION:-latest}
    container_name: ${COMPOSE_PROJECT_NAME}_mysql
    volumes:
      - ./mysql:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${DATABASE_PASSWORD:-password}
      - MYSQL_USER=${DATABASE_USER:-root}
      - MYSQL_PASSWORD=${DATABASE_PASSWORD:-password}
      - MYSQL_DATABASE=${COMPOSE_PROJECT_NAME:-wordpress}
    restart: always
    ports:
      - 33062:3306

Prepare proof of concept (small validation)

Prepare small validation for transformo, with only a few features in the migration feature model. Once this validation is successful, we will prepare a realistic validation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.