Skip to content

andrefabbro/liferay-database-migrate-tools

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to use this project to replace Liferay's scheme types.

Steps

  1. Download your bundle version from https://customer.liferay.com/en_US/downloads

  2. Create a MySQL Docker image, using the following command:

docker run -it --name mysql_master -p 3307:3306 -e MYSQL_ROOT_PASSWORD= -e MYSQL_DATABASE=lportal -e MYSQL_ALLOW_EMPTY_PASSWORD=yes mysql:5.7 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
  1. Go to the bundle you just downloaded, and in the root folder, create a file portal-ext.propeties and put the following properties:
jdbc.default.driverClassName=com.mysql.cj.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost:3307/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=
  1. Now, go to the tomcat/bin folder in your bundle, and run: ./catalina.sh jpda run

  2. After starting the portal, go to the docker container and extract a dump file:

  • Go to docker container:
docker exec -it mysql_master bash
  • Run the following command to generate a dump
mysql -u lportal lportal > [name-file-dump.sql]
  • Copy the dump out from the container:
docker cp mysql_master:/[name-file-dump.slq] [destination folder]
  1. Now, put both dumps (the customer dump, and the extract dump from your bundle version) in the /src/main/resources/

  2. Rename the environment variables in Main.java to your files, following the rules below:

  • _SOURCE_FILE_NAME: Name file dump with the Liferay Scheme.
  • _TARGET_FILE_NAME: Name file dump with the Customer Scheme.
  • _NEW_FILE_NAME: New file name output.
  1. Run the project

Note

This project will assist just the replacing the types. You will need to use other tools to migrate differents database types, like Pentaho, for example.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%