This document is outdated and kept here only for reference. Please consult the current XML Content Migration Documentation.
The XML Migration Plugin is an internal framework used by Jive Professional Services to aid in customer migration engagements. The plugin processes a set of XML files, which represent content exported from the customer's source platform. The high-level data flow during the actual migration is as follows:
- Download the attached Samples and XSD archive.
- Extract it and inspect the folder structure.
- Create an XML export for one of your source object types, typically users.
- Match the XML bean definition provided in the samples.
- Match the file structure, i.e. more than one bean per file, but no more than 100 MB compressed per XML file.
- Match the provided folder structure exactly for each content type.
- Ensure that generated XML is exclusively UTF-8 encoded.
- Wrap non-conforming content in <![CDATA[ ... ]]> sections.
- Validate the generated XML using the XSD.
- Validate XHTML contents of any object type that contains markup.
- Repeat for all necessary source content types.
- ZIP all contents into a single archive and send to Jive for review/testing.
- Do not use TAR and/or gzip formats.
- Ensure you are using the correct compression tool parameters to encode file names as UTF-8.
- Please be aware that Windows has a 255 character limit for file name lengths, but with the folder structure provided you should not run into that.
- Tip: When migrating binary documents, it can be very helpful to have a small program to run thru the generated XML, and validate the file path & filenames correctly match what's actually on the filesystem in the /attachments folder. Its much easier for a client to create such a program, rather than let the migration framework find the problems on very large sets of files.
- The names of the element type folders are mandatory–they must be these names and uppercase.
- The XML file names within each folder are arbitrary.
- All files must start/end with the <importSource> tag.
- All dates must be provided as milliseconds since the epoch, for example 1242365364000 for Fri, 15 May 2009 05:29:24 GMT.
- All numeric values must not contain leading zeros, i.e. not look like 00123.
- The entire export must be compressed in a single ZIP archive, named <customer>-xml-YYYY-MM-DD-N.zip, containing the timestamp of the export and a running number N starting at 1 to support providing more than one export per day.
XML Schema Specifications
Most requirements for the XML beans are encoded in the attached XSD files. Use schema1.xsd for validation.
- There are several abstract bean types defined with common element definitions, from which all other bean definitions derive. It is generally easier to start from the samples and use them as documentation rather than navigating the XSD, unless your XML tool has full XSD support.
- Each bean must have a unique ID among all beans of the same type. The same ID, however, can be reused across different types. For example there can be both a blog post and a discussion message each with the ID 1001.
- Any ID that references another bean's ID must actually exist in the other bean definition. For example, a blog post's UserID must correspond to an existing bean of type USER with that same ID.
- The SourceID is generally not provided. Each bean's ID element is considered your source system's ID.
- For any bean deriving from PropertyBean, a <properties> element is required, even it is empty. These properties are occasionally used for custom migration and transformation requirements.
- Any bean derived from ContainableBean can specify a container to which it belongs, which is always a combination of container type (see folder names for permissible values) and container ID.
By default, a source users will be mapped to an existing user if there is an exact match on either username or email. <registrationStatus> should be REGISTERED.
Valid visibility levels for element levelID are:
- 1000: ALL_USERS (includes guests)
- 1001: REGISTERED_USERS
- 1002: COLLEAGUES
- 1003: CONNECTIONS
- 1004: CONNECTIONS_AND_COLLEAGUES
- 1005: OWNER (private, visible only to user)
- 1006: ALL_BUT_PARTNER_USERS
- <containableTypes> must list each type of containable type for each community, ie: FORUM if you are loading discussions, DOCUMENT if you are loading documents–otherwise the discussions or documents wouldn't show once migrated. The list of valid types here is again the sample folder names.
- <parentCommnityID> should have a value of 1, unless you are loading a hierarchy of communities, in which case the ID must refer to another community bean that comes before it in the file(s).
- <ID> in <socialGroupBean>: should have a unique value across all the other socialGroupBean elements. It should be a positive Integer, with NO leading zeros either (00123)
- <containableTypes>: You must list each type of containable type for each SocialGroup (ie: FORUM if you are loading discussions, DOCUMENT if you are loading documents–otherwise the discussions / documents / blogs etc wouldn't show once loaded, BLOG for blogs and so on...)
- <userID> in <socialGroupBean>: should have a value that matches the userBean <ID> value for the SocialGroup (see the userBean docs)
Social Group Member
The Social Group Member content type is the way to add users to a Social Group. The user who is the owner of the Social Group is typically added as part of the SocialGroupBean itself (see above), so SocialGroupMemberBeans is normally used to simply add additional members to the SocialGroup.
- <memberTypes>: You must pick ONE type of member SocialGroupMemberBean (ie: typically this would be set to MEMBER, since the owner is going to likely already be set from the socialGroupBean itself (see the SocialGroup content type documentation above). However, see the memberType enum above for the complete possible list of memberTypes.
- <userID> in <socialGroupMemberBean>: should have a value that matches the userBean <ID> value for the SocialGroupMember (see the userBean docs)
Projects are a bit unique, in that they are contained by either a SocialGroup or Space (Community) AND they themselves contain other content, like Documents or Blogs etc. The project may only contain content types which are allowed by its parent container ... Social Group or Space (Community)
- <containerID> in <projectBean>: should have a value that matches the container for the projectBean (see the communityBean / socialGroupBean etc etc)
- <containerType> value should be set to: COMMUNITY or SOCIAL_GROUP (all caps) depending on what type of container the project is to be migrated into.
- <userID> in <projectBean>: should have a value that matches the user for the projectBean (see the userBean)
The primary elements to focus on are: currentVersion (type documentVersionBean), & binaryBody (type binaryDocumentBodyBean)
- <containerID> in <documentBean>: must match the container for the documentBean
- <containerType> value should be set to: COMMUNITY or SOCIAL_GROUP (all caps) depending on what type of container the document is to be migrated into.
- <userID> in <documentBean>: should have a value that matches the user for the documentBean (see the userBean)
- <ID> in <currentVersion>: can just set this to the value of 1 (note: simply needs to be unique across all versions of the document within <documentBean> )
- <userID> in <currentVersion>: just set this to the same userID value as in <documentBean>
- <ID>, <containerID>, <containerType>, <userID> in <binaryBody>: just set all these to the same values as in <documentBean>
- <name> in <binaryBody : this should be the name of the file.
- <url> in <binaryBody> : this is the full folder path & filename where the file can be found on the filesystem. It would be a relative path underneath the /attachments/ folder.
For example:, in the Directory Structure section described above, there is an /xml-data folder, with an /attachments/ folder underneath it like this: /xml-data/attachments/
If you were to have a file to migrate called test.pdf, and it was in a folder within the attachments directory like this: /xml-data/attachments/sales/pdfs/test.pdf
then for the <url> value in the xml, you would want: <url>/sales/pdfs/test.pdf</url>
(be aware of some gotchas with folder & filename paths, see Tips & Recommendations section above)
- containerID should match the ID value defined the the User elements IF this is a personal blog, otherwise, it needs to match the ID value for the SocialGroup if it will be going into a socialGroup. It does not need to be the userid of the Jive user account in the existing instance.
- If your blog will be a personal blog, then containerType should be USER_CONTAINER for personal blogs
- If your blog will be going into a Social Group, then containerType should be SOCIAL_GROUP for social group blogs.
- If your blog will be a SystemBlog, then containerType should be SYSTEM_CONTAINER, and containerID should be 0 (zero)
- attachmentState element must be included and set to PRESENT if the blog has an attachment
- blogID should be the same as the ID element value for the parent Blog defintion
- creationDate, modificationDate, and publishedDate are required (even though minOccurs=0)
- Value of "body" element must be a valid XHTML. It should be the contents within an XHTML body element. It is recommended to put the contents of this element in a CDATA block. The literal entities <, &, >, ', and " must be encoded using <, &, >, ' and " .
- The blogID, publishedDate, and permalink must be a unique tuple among all blog posts. Jive uses these to uniquely identify a blog post, so if there are posts with duplicate of these tuples, only one post will be displayed.
- containerID should be the ID of the Blog Post that the Attachment should be attached to
- containerType should be user container type: BLOG_POST
- parentObjectID should be set to -1
- body must be valid XHTML
- parentCommentID should be 0 (or omitted) for non-nested comments. For nested comments, it should be the ID of the parent comment.
- commenterInformation should contain the ID fo the User who made the comment.
- containerID should be the ID of the Blog Post that the Attachment should be attached to
- containerType should be user container type: BLOG_POST
- mimeContentType should be the MIME type of the attachement, e.g., application/pdf
- The name should be the filename of the attachment
- The contents of the attachement can either be specified by the data element as a base64 encoded value or as a path in the url element. Using the url element is recommended if there there are a large number of attachments to migrate. One of these two elements must exist.
Tagged Content & Tags
- containerID should be the ID of the content (e.g., document, blog post, message) that the tags should be set on. It should should not be the container in which the content is in.
- containerType should be Content Type that the tag is being set on (e.g., DOCUMENT, BLOG_POST, DISCUSSION_MESSAGE)
- The TagBean bean being referenced must exist.
- containerType will be the type of the content in which the image is embedded, e.g., BLOG_POST
This example uses the "data" element, but you can also use "url" (see 2nd example)
<?xml version="1.0" encoding="UTF-8"?> <importSource xmlns='http://www.jivesoftware.com/migration'> <imageBean> <ID>21</ID> <properties/> <containerID>245</containerID> <containerType>BLOG_POST</containerType> <mimeContentType>image/jpeg</mimeContentType> <data>/9j/4AAQSkZJRgABAgEAYABgAAD/QQd7=</data> <name>test.jpg</name> </imageBean> </importSource>
The code will look for embedded images in the body of discussion messages.
This includes the root message in discussions. The tag in the message needs to contain an img tag with an attribute called "__embedded_id". The value needs to match an id in the images XML file you are importing.
This works the same way for Blogsposts etc
For example, the reference to the above image within the body of a blog post would look like:
<p>image test <img __embedded_id="21" src="test.jpg" alt="this is a test image" /></p>
This example uses the "url" element to indicate the folder/path & filename of the file on the filesystem
<?xml version="1.0" encoding="UTF-8"?> <importSource xmlns="http://www.jivesoftware.com/migration"> <imageBean> <ID>56789</ID> <properties/> <containerID>101</containerID> <containerType>BLOG_POST</containerType> <userID>2001</userID> <mimeContentType>image/jpeg</mimeContentType> <name>dentist1.jpeg</name> <url>dentist1.jpeg</url> </imageBean> </importSource>
The migration framework has the ability to setup users to be following certain Places & Content. (Could be updated to work for following other users if needed)
With this in mind, a "follow" is treated like other content is, in this case an XML source data file.
Migrating a follow is fairly straightforward.
Even though a follow isn't really "content", and is also not "contained" by any containers, we're treating like it is, so we easily re-use parts of the migration framework to do it.
- <ID> in <followBean>: should have a unique value across all the other followBean elements
- <containerID> in <followBean>: should have a value that matches the container for the followBean (see the communityBean / socialGroupBean / projectBean etc etc)
- <containerType> value should be set to: COMMUNITY or SOCIAL_GROUP or PROJECT (all caps) (also see example XML for more "containers") depending on what type of "container" the follow is to be "migrated to" for the user.
- <userID> in <followBean>: should have a value that matches the user for the followBean (see the userBean)
In previous versions of the XML schema, view counts for object were migrated as part of the object for which the occurred. They are now migrated as a separate ViewCountBean:
<viewCountBean> <ID>1000</ID> <objectType>14</objectType> <objectId>1</objectId> <viewCount>17</viewCount> </viewCountBean>
- <ID> is an arbitrary unique ID for the view count instance.
- <objectType> refers to the type of object for which the view count is migrated
- <objectId> uniquely identifies the "viewed" object
- <viewCount> specifies the number of views for that object
The migration is initiated from the Jive admin console and thus executes in a running instance of Jive:
- Remove the node that is running the migration from any cluster configuration.
- Shut down all other nodes.
- Ensure EAE is up and running and healthy (in the Jive instance's admin console).
- Configure and execute the migration. Details on how to do so will be provided by the PS Engineer engaged on your migration project.
- It is recommended to rebuild content indexes and to restart Jive when the migration completes.
Reference – Object Type IDs
|USER RELATIONSHIP LIST||53|
|DOCUMENT VERSION COMMENT||121|