Christopher_Mal
ServiceNow Employee
ServiceNow Employee

OK, this is just a quick blog post on something that actually had me stuck for a while this week. I am almost embarrassed to mention this, but I will anyway. I tried to copy images from one production instance into another. I tried exporting them as XML and reimporting them. I tried doing a RemoteGlideCopy. I tried giving sacrifices to the gods of base64 encoded data. None of that worked. The solution was simple once I figured it out. Use an update set.

Yes, update sets capture images in their updates (including the base 64 encoded payload for the image itself). I had over 2000 images to update and include in my update set, so doing each update manually was a fool's errand. You can very nicely right click on the list of images header and UPDATE ALL. That will force everyone of those images into that update set, and yes it will bring them over when applied on another instance.

I wish I could take full credit for figuring it out, but I can't. There were a couple of key pieces I received from skilled consultants that helped me figure it out. How lame is this post right? Don't judge me though, one day you may be stuck on something so easy and stupid and wish someone had the balls to do a blog about it. 🙂 Cheers all. Happy coding.

Steps to do:

Step 1: Create an update set on the source instance
Step 2: Click on the Images module
Step 3: Right click the header and update all
Step 4: Make the update
Step 5: Complete the update set and apply on new instance
Step 6: Rejoice with a refreshing cold beverage

A really good Wiki explaining how how attachments are used in our SNC system:
http://wiki.service-now.com/index.php?title=Administering_Attachments

Viewing Attachment Tables
When you store an attachment to any table, a record is created in the sys_attachment table that contains attachment metadata, and the file data is stored in the sys_attachment_doc table, in 4k chunks. For example, if you attach a 12k file called My_attachment.pdf, then you would have a sys_attachment entry with 3 related sys_attachment_doc entries.