Skip to content

Migrating a Server Instance and its Data

Thomas Jejkal edited this page Nov 19, 2020 · 1 revision

Currently the urls in the triples pointing to the WADM server instance are hardwired (hostname and port). To migrate the server to a new host or port, the triples in the database have to be updated, otherwise the triples will be retrievable by the SPARQL endpoint but will not be used by the WADM server otherwise.

Steps to do so:

  • stop the current server if running
  • use tdb2.tdbdump on current databasepath (the path found in the application.properties file of the current server), e.g. <JENA_HOME>/bin/tdb2.tdbdump --loc /mnt/lsdf/old-wadmserver-data/database/ -v > tdb.dump
  • restart current server
  • install new server. configure the installation script / application properties with new hostname and wap port. Set the path where the new database will be. Do NOT start the server yet (since this would create unwanted data). New application.properties example (snippet)
DataBasePath=/mnt/lsdf/new-wadmserver-data/database/
Hostname=episteme2.scc.kit.edu
WapPort=8100
  • update the data dump of the database and change hostname and/or port in the triples. E.g. sed s"/episteme2.scc.kit.edu:8090/episteme2.scc.kit.edu:8100/g" tdb.dump > tdbUpdated.nq
  • load the updated data dump into the new database location, e.g. <JENA_HOME>/bin/tdb2.tdbloader --loc /mnt/lsdf/new-wadmserver-data/database/ tdbUpdated.nq
  • start the new server

Notes:

  • tdbloader has to determine the format to load from the file ending, so make sure that the dump file is named according to the data format (.nq, .nt, .ttl, etc.)
  • the subfolder Data-001 is used/created automatically by tdb2, so both tdbdump and tdbloader should point to the parent folder of that folder.
  • Make sure to use the correct loader. tdb2loader is part of TDB1 and cannot be used with a TDB2 database, which is used within the WADM server.
  • tdb2.tdbloader is able to load into an existing database. This will just add the new triples and keep old ones, so most likely in this process it will lead to unintentional behavior/data. Make sure to load into an empty database folder.

TLDR:

<JENA_HOME>/bin/tdb2.tdbdump --loc <old database path> -v > <dumpfile>
sed s"/<oldhost>:<oldport>/<newhost>:<newport>/g" <dumpfile> > <dumpfile updated>.nq
<JENA_HOME>/bin/tdb2.tdbloader --loc <new database path> <dumpfile updated>.nq

Clone this wiki locally