Skip to content
Markus Sabadello edited this page Jun 9, 2015 · 10 revisions

Introduction

This page describes how XDI graphs can be migrated through the "Star Shift" using xdi2-tools. For more information about this shift, see star-shift on the main XDI2 wiki.

Resources

The term "old XDI2" refers to an XDI2 server and/or graph before the shift.

The term "new XDI2" refers to an XDI2 server and/or graph after the shift.

The following links are useful for this process:

Manual process ("editing")

To convert a single not very large graph, the following process should be used.

  1. Obtain a serialization of the "old XDI2" graph (either "XDI/JSON" or "XDI DISPLAY" format) in a text file or clipboard.
  2. For example, the graph can be copied out of an "old XDI2" admin web interface.
  3. Open the "old XDI2" XDI Converter tool: http://server.xdi2.org/pre-star-shift/XDIConverter
  4. Paste the graph into the tool
  5. As output format, select "XDI DISPLAY STARSHIFT", click Go.
  6. This returns the converted "new XDI2" graph.
  7. For example, the "new XDI2" graph can then be copied into a "new XDI2" admin web interface.

Automatic process

To convert all graphs known to an XDI2 server, the following process should be used:

  1. Deploy the xdi2-tools on the "old XDI2" server environment.
  2. xdi2-tools itself is agnostic to either "old XDI2" or "new XDI2", but make sure it is using the "old XDI2" core code base.
  3. Make sure xdi2-tools has access to the "old XDI2" server applicationContext.xml configuration file(s), as well as to all the XDI2 plugins used by the server (e.g. xdi2-mongodb, xdi2-connector-facebook, etc).
  4. Make sure xdi2-tools has access to the persistence layer (e.g. MongoDB).
  5. Launch xdi2-tools with the following parameters: backup-graphs mybackup.zip text/xdistarshift [path-to-applicationContext.xml]
  6. This should output the file mybackup.zip, containing serialized "new XDI2" graphs
  7. Look into the .zip file, make sure it contains the expected number of graphs, and open a few of them to see if they look good
  8. Rename the graph files inside the .zip file (see below "Additional considerations"), e.g. [=]!:uuid:b84bec65-48e6-45d3-9dae-a21bcbd26758.xdi -> =!:uuid:b84bec65-48e6-45d3-9dae-a21bcbd26758.xdi
  9. Stop the XDI2 server, and migrate the "old XDI2" server environment to "new XDI2".
  10. Manually clear the contents of the persistence layer (e.g. MongoDB).
  11. Launch xdi2-tools with the following parameters: restore-graphs mybackup.zip [path-to-applicationContext.xml]
  12. This should restore all graphs into the "new XDI2" server environment. If individual graphs cannot be restored, xdi2-tools should skip them and print an exception.
  13. Start the XDI2 server, and make sure everything looks good.

Additional considerations

XDI endpoint URIs

The XDI endpoint URIs change after this shift, e.g.

https://ote.danubeclouds.com/xdi/cl/%5B%3D%5D%21%3Auuid%3Ab84bec65-48e6-45d3-9dae-a21bcbd26758 --> https://ote.danubeclouds.com/xdi/cl/%3D%21%3Auuid%3Ab84bec65-48e6-45d3-9dae-a21bcbd26758

https://ote.danubeclouds.com/xdi/cl/%5B%2B%5D%21%3Auuid%3A5afb92c2-b969-4d3a-b751-abe8a47ae052 --> https://ote.danubeclouds.com/xdi/cl/%2B%21%3Auuid%3A5afb92c2-b969-4d3a-b751-abe8a47ae052

Literal values may have to be updated accordingly.

File names in backup

To rename files in mybackup.zip:

rename -v 's/\[\=\]/=/' *.xdi
rename -v 's/\[\+\]/+/' *.xdi