Migration to DMProadmap - portagenetwork/roadmap GitHub Wiki

Overall Process

In order to migrate from DMPonlinev4 to DMPRoadmap, a number of scripts need to be run, in conjunction with some modifications to the database. Next, to migrate from DMPRoadmap v1.0.0 to v2.0.0, some further database migrations and scripts will need to be run. At this point, you will be able to check your data according to the validations added to the project.

As the rake:tasks and migrations rely on Rails objects, an easy way to ensure the correct versions of these, while also allowing modifications down the line was to create a branch on your repository for each of these steps.

Running order

  1. https://github.com/portagenetwork/roadmap/issues/2 DMPonline->Roadmap step 1
  2. https://github.com/portagenetwork/roadmap/issues/3 DMPonline->Roadmap step 2
  3. https://github.com/portagenetwork/roadmap/issues/4 DMPonline->Roadmap step 3
  4. https://github.com/portagenetwork/roadmap/issues/5 Roadmap v0.3.8
  5. https://github.com/portagenetwork/roadmap/issues/6 Roadmap v1.0.0
  6. https://github.com/portagenetwork/roadmap/issues/7 Roadmap v1.1.0
  7. https://github.com/portagenetwork/roadmap/issues/8 Roadmap v1.1.3
  8. https://github.com/portagenetwork/roadmap/issues/9 Roadmap v2.0.0 (Data Validations Part 1)

Docker

To keep environment/setup simple, I've added a minimal docker-compose setup to capture the dependancies for the application, and to provide a mysql database. These files are included within each migration branch, in the top-level directory of the Roadmap project.

Interacting with the containers

As I'm using the containers more for dependancies, I perfer to execute bash on the container and simply run my commands from there. This can be done by running :

$ docker-compose run --rm server /bin/bash

From there, you can interract with the rails app as if it was installed on your machine.

Create the setup

Before running the migrations, you will need to build the server container with :

$ docker-compose build server

In step ____, DMPRoadmap upgrades it's ruby version to 2.4.4, requireing this to be run again.

Interacting with the database

As a convienence, I have mapped the ../db_backups/* directory to /tmp/dat/ within the container.

(for clarity, this would be a db_backups/ directory in the same directory where your roadmap directory is, assuming you didn't re-name the git-repository when you cloned the project)

Initilize database

Assuming you've placed a sql dump of your database at ../db_backups/portage-db.sql on your host machine, you can initilize the database by running:

$ bundle exec rake db:create
$ mysql -u $MYSQL_USER -h db --password=$MYSQL_PASSWORD $MYSQL_DATABASE < /tmp/dat/portage-db.sql  

Write database to file

You can write your database out to ../db_backups/portage-step-x.sql on your host machine by running:

$ mysqldump -u $MYSQL_USER -h db --password=$MUSQL_PASSWORD $MYSQL_DATABASE > /tmp/dat/portage-step-x.sql

Themes

The set of themes in the Portage instance of DMPonlinev4 differs slightly from those assumed by DMPRoadmap. The roadmap project has since simplified these themes further, with the details of this specified in this wiki page. Functionally, any set of themes will work with the DMPRoadmap codebase, although we're thinking of coupling some of those specified in the wiki page to a RDA maDMP export workflow.