How to preserve/restore the sp_portal.icon value after a clone between instances?

laurelin
Mega Contributor

NOTE: I previously posted this in the "Now Platform" forum, I guess it was the wrong place.  Hopefully the developer community will have some useful input.

Background: we have different colored "themes" (I use the term loosely, not technically) in our various instances so that the developers are visually aware of which instance they are currently using.  In particular, the favicon is a different color in each instance.

Before we deployed a service_portal, it was easy to run our post-clone cleanup script to change the name of the glide.product.icon system property.  The favicon was referenced by name, hence our dev environment uses "dev-favicon.ico", our production environment uses "prd-favicon.ico", etc.

But now in the sp_portal table, the icon isn't a NAME, it's an actual file upload.  And whenever we clone from one instance to another, the icon in the target instance changes color to whatever-was-the-source instance, for all portal pages.  That's a serious problem here.

From my reading of the documents, it looks like using "Exclude Tables" and "Data Preservers" could be used, but this would prevent *ANY* change to the sp_portal table records.  That is: if we changed attribute login_page or knowledge_base (or just about any other attribute of the sp_portal record), we probably *would* want the changes to be copied into the target of the clone; the ONLY thing we do not want copied is the icon attribute; and from my reading, this is not how "Exclude Tables" and "Data Preservers" work.  Am I misunderstanding the docs?  UPDATE: from HI incident INT3678937, no I am not misreading the docs.  Data Preservers preserve an entire record, not individual fields in the record.

If it is not possible to preserve ONLY the icon attribute, then is it possible to do an automated upload to the icon field in our post-clone cleanup script?  How would I go about this?  I do have access to the MIDserver, and I could place the icon source images in well-known locations on the MIDserver.  But I do not know how I would go about duplicating the steps that I take when I click on the "Update" and "Choose File" and "OK" buttons of the interactive way to restore the icons.

Thanks in advance.

-- lauri

 
10 REPLIES 10

laurelin
Mega Contributor

And just to be sure: I create these records in the SOURCE instance, correct?  Or the target?  Or both?

Thank you, lauri

source instance

laurelin
Mega Contributor

Thank you!  I will let you know on Monday if this worked or not.  -- lauri

laurelin
Mega Contributor

And the answer is: NO, it did not work.  None of the icons were preserved after the clone.  Funny thing, though: the icons didn't all come from the source instance either.  

What I mean (in case you are reading further):

The colors of our instances include:
Blue = production
Grey = training
Green = integration

We have 4 records in sp_portal that need to be updated after every clone.  And after every clone, I've manually gone in and uploaded 4 icons of the right color for the instance.

The clone this past weekend was from train (gray) to integration (green).  After the clone, two of the icons in the target instance were gray (as expected), but two of them were blue (?!).  As if they'd reverted to their "production" configuration.  Very very strange.

In any case, I will go update them manually again now.  And wish that servicenow had done the sensible thing of having an icon NAME rather than an uploaded file in the sp_portal record.

 

-- lauri

 

G24
Kilo Sage

@laurelin or @Jon Barnes Did you ever figure out how to preserve these portal images (ONLY) across clone operations?  What is the final answer?  Thanks.