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)
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>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)
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>Stop ontoportal services :
sudo systemctl stop 4s-httpd.serviceCopy the new repository directory
cp -fi <path where is the repositroy directory> /srv/ncbo/Restore the 4store dump
cd <where is the data directory> && find . -type f | 4s-restore ontologies_apiRestarting ontoportal services
sudo opstartReprocessing all ontologies
cd /srv/ontoportal/ncbo_cron bundle exec bin/ncbo_ontology_process -a