Service Desk Practitioners Forum
cancel

Attachment export

SOLVED
Go to solution
Highlighted
_Jaime_
Super Contributor.

Attachment export

Hi all,

We need to export all Service Desk attachments to import in another application.

How can we do this?

Thanks,
Jaime
13 REPLIES
Err_1
Acclaimed Contributor.

Re: Attachment export

Jaime,

What do you mean by another application?

You mean you need to move them from current server into another server? If so, just keep the same directory structure in new server.

Regards;

Randall Barrantes
SW Support Delivery Manager
_Jaime_
Super Contributor.

Re: Attachment export

Hi,

No, we need to export the attachments to Service Manager.

Thanks
Jaime
The Pike
Acclaimed Contributor.

Re: Attachment export

Good luck with that one.
I am not sure if HP offers to migrate attachments along with your item data from Service Desk to Service Manager.

If I had to do it from scratch, I would probably build a script to extract file name and location from the sd database and copy the file with its original file name and to a new target location based on entity/item id.

Hope that helps.
Points (and pints) are welcome.

The Pike
_Jaime_
Super Contributor.

Re: Attachment export

Hi,

Thank you for your answer.

Well, we were thinking about doing that.

Get a relation between the Service Desk record (CMDB, Service Call, etc) and the filename in the Filesystem.

After that import the attachments to Service Manager.

The only question is, is there a way to get the relation between the two? That is, the record and the filename(s) attached to it?

Jaime
The Pike
Acclaimed Contributor.
Solution

Re: Attachment export

I think this oughtta do it for Service Calls.
Give it a try and let us know if it works.

SELECT ahs_basename, ser_id
FROM rep_attachments, ifc_entities, itsm_servicecalls
WHERE ahs_ent_oid = ent_oid
AND ent_name = 'Service Call'
AND ser_oid = ahs_att_oid

Points (and pints) are welcome.

The Pike
The Pike
Acclaimed Contributor.

Re: Attachment export

Oh, and if you're thinking about the filename in the FTP server, that's a whole other story and the filename and folder structure must be deciphered using the docu that explains the attachment structure in SD4.5.

Points (and pints) are welcome!

The Pike
_Jaime_
Super Contributor.

Re: Attachment export

Hi The Pike,

Thanks for your replies.

Yes, that is what we were thinking of. Relating the filenames in the FTP server to the record id from Service Desk and then importing all of them into Service Manager.

Is there a document covering how the filenames and structure is built?

Thanks,
Jaime
The Pike
Acclaimed Contributor.

Re: Attachment export

Yes, check pages 152 and 153 of the SP20 addendum.

http://support.openview.hp.com/selfsolve/document/KM17064/binary/sd45_sp20_addendum_en_pdf

Points (and pints) are welcome.
The Pike
_Jaime_
Super Contributor.

Re: Attachment export

Thanks.

I will check that.

Sorry about only giving Points and not Pints also :)

Jaime
_Jaime_
Super Contributor.

Re: Attachment export

Hi again.

I do not have access to Service Desk right now.

I've read the pages in the document, and the SP we are using is prior to SP16.

That means that getting the files from Service Desk would be possible if we can get the relation between the ServiceCall ID (as in the example 281479802001001) and the attachment ID (281479802002001).

Example:
/opt/OV/sd/attachments/servicecall/281479802001001/281479802002001

Does the query that The Pike has posted, return this?

BTW, does anyone have the DB diagram from Service Desk? I've had to build some queries to gather some data to export, and trying to guess what the tables/fields could have is a perfect nightmare as all of you should know...

Thanks,
Jaime
The Pike
Acclaimed Contributor.

Re: Attachment export

Jaime,
That's not what my query returns.
Mine returns the Service Call ID and the file name.

The path to the file is not stored in the database. The path is built with the entity oid and the attachment oid. If you are using SP16 or higher, the path is built out of converting the entity oid and the attachment oid to hexadecimal equivalents.

To get the attachment oid and the entity oid in the query, simply add the ahs_oid and ent_oid columns.

The ER diagrams have been posted previously but I don't have the link nor the files handy. Quick search in the forums with the proper keywords will take you to them.

Points are welcome.
Don't worry about the pints!

The Pike
_Jaime_
Super Contributor.

Re: Attachment export

We've solved this question creating a temp SQL table to gather all the info and the attachment also.

Thanks to all,
Jaime
ferrata's
Valued Contributor.

Re: Attachment export

Hi Jaime,

We have the same problem with the attachments and We have stop with these.
Could you explain us how to do the attach export from Service Desk to Service Manager. (We work with Service Desk 4.5 SP18 and Service Manager 7.11)

thank you a lot for any information to this issue

Best Regards,

David