Data migration 

Idea

The idea is to copy all the data of an existent portal , for having a dump that can be used after to restore the data if lost or to use in a new instance.

Dump the data of a portal

Steps to flow (inside the server where is the portal to dump)

  1. Dumping 4-store data (this command will create a "data" folder containing a dump of the 4store triple store

    sudo 4s-dump http://localhost:8081/sparql/ -a -o <path where to create the data folder>
  2. Gzip the created "data" folder and the "/srv/ontoportal/data/repository" (where are the original data of the ontologies)

    tar -zcvf backup.tar.gz <path to the data folder> /srv/ontoportal/data/repository

Restore and process the data

Steps to flow (inside the server where is the portal to restore)

  1. Copy the backup tar file (4s-dump data + repository folders) into the remote

    scp -r -p  <remote server>:<remote path to the backup tar file> <path where to put the tar file>
    tar -xzvf <path where is the tar file>
  2. Stop ontoportal services :

    sudo systemctl stop 4s-httpd.service
  3. Copy the new repository directory

    cp -fi <path where is the repositroy directory> /srv/ncbo/
  4. Restore the 4store dump

    cd <where is the data directory> && find . -type f | 4s-restore ontologies_api
  5. Restarting ontoportal services

    sudo opstart
  6. Reprocessing all ontologies

    cd /srv/ontoportal/ncbo_cron
    bundle exec bin/ncbo_ontology_process -a