-
Notifications
You must be signed in to change notification settings - Fork 0
Star Shift
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.
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:
- An instance of the "old XDI2" web tools: http://server.xdi2.org/pre-star-shift/
- An instance of the "new XDI2" web tools: http://server.xdi2.org/
- A snapshot of the "old XDI2" code base: https://github.com/projectdanube/xdi2/tree/snapshot-0.7-pre-star-shift
- The xdi2-tools: https://github.com/projectdanube/xdi2-tools
To convert a single not very large graph, the following process should be used.
- Obtain a serialization of the "old XDI2" graph (either "XDI/JSON" or "XDI DISPLAY" format) in a text file or clipboard.
- For example, the graph can be copied out of an "old XDI2" admin web interface.
- Open the "old XDI2" XDI Converter tool: http://server.xdi2.org/pre-star-shift/XDIConverter
- Paste the graph into the tool
- As output format, select "XDI DISPLAY STARSHIFT", click Go.
- This returns the converted "new XDI2" graph.
- For example, the "new XDI2" graph can then be copied into a "new XDI2" admin web interface.
To convert all graphs known to an XDI2 server, the following process should be used:
- Deploy the xdi2-tools on the "old XDI2" server environment.
- xdi2-tools itself is agnostic to either "old XDI2" or "new XDI2", but make sure it is using the "old XDI2" core code base.
- 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).
- Make sure xdi2-tools has access to the persistence layer (e.g. MongoDB).
- Launch xdi2-tools with the following parameters: backup-graphs mybackup.zip text/xdistarshift [path-to-applicationContext.xml]
- This should output the file mybackup.zip, containing serialized "new XDI2" graphs
- 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
- 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
- Stop the XDI2 server, and migrate the "old XDI2" server environment to "new XDI2".
- Manually clear the contents of the persistence layer (e.g. MongoDB).
- Launch xdi2-tools with the following parameters: restore-graphs mybackup.zip [path-to-applicationContext.xml]
- 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.
- Start the XDI2 server, and make sure everything looks good.
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.
To rename files in mybackup.zip:
rename -v 's/\[\=\]/=/' *.xdi
rename -v 's/\[\+\]/+/' *.xdi