Would like to wipe an Assets catalog and import fresh

What’s the best / supported / safest way to do this?

  • I have a backup of the entire database
  • I have an export of this Assets catalog as it is now

Edit: I should mention: the main reason I’d like to do this is that on my initial creation of the catalog, I have the workstation hostname as just a field, and RT has assigned them an internal ID, in the order they were created. On import, the workstation name will be the ID field and therefore the list will look sensible, more or less in order, during searches - since the name will always need to be unique anyway.

I have a new master CSV that I would like to import into this catalog as the definitive list. I have, in the current catalog (“Desktop Workstations” in this case), created some new Custom Fields and applied them to this catalog, which will be populated by the new import. I have also re-arranged some of the existing fields, their data, format, etc.

I’d like to drop the existing entries, in their old format, and just import the whole thing from this master CSV which was created by dumping existing assets, adding the new fields to correspond to new custom fields, altering data where needed to match the new format, and then additional fresh entries were added to it.

Is there a supported mechanism to drop this catalog, other than doing it manually via SQL?

I’ve had a quick look and Assets and Catalogs aren’t in the @RT::Shredder::SUPPORTED_OBJECTS list, so it doesn’t look like you can use the shredder to nuke asset or catalog objects (checked in 4.4.3 and 4.4.4). You also can’t use the Delete() method with an RT::Asset as the documentation specifically says assets can not be deleted so it always returns an error.

So to me it looks like its back to the SQL command line to do the wiping out I’m afraid.

Hi Jim! Happy Holidays and suchlike.

Actually, after thinking about it a bit, I’ve decided the sanest thing to do is simply import the new master list as a new catalog with a slightly different name; and then disable the original catalog. Er, I’m assuming disabling a catalog is a thing, but I’d be surprised if it isn’t since “disable > delete” seems to be the RT way. That way I’ll have my historical archive if needed for whatever reason, no one else will see it, and the new catalog will get a nice clean start without worrying if I left any messy SQL bits dangling about.