--- tags: fbc,migration title: OPM Catalog Commands Migration --- # OPM Catalog Commands Migration ## Migrating from legacy commands ### OCP docs references 1. <a name="bib1">[OPM CLI](https://docs.openshift.com/container-platform/4.12/cli_reference/opm/cli-opm-ref.html)</a> 2. <a name="bib2">[Managing custom catalogs](https://docs.openshift.com/container-platform/4.12/operators/admin/olm-managing-custom-catalogs.html#olm-managing-custom-catalogs-fb)</a> 3. <a name="bib3">[OLM on restricted/disconnected networks](https://docs.openshift.com/container-platform/4.12/operators/admin/olm-restricted-networks.html)</a> 4. <a name="bib4">[oc mirror](https://docs.openshift.com/container-platform/4.12/installing/disconnected_install/installing-mirroring-disconnected.html)</a> ### common operations #### creating catalog 1. OCP docs, section "Creating a file-based catalog image" [(2)](#bib2) #### extract catalog from image 1. `opm render` desired output is a streamable json/yaml blob of all contents [(1)](#bib1) 2. `opm migrate` moving from SQLite to FBC and want to preserve filesystem hierarchy [(BZ:2056337)](https://bugzilla.redhat.com/show_bug.cgi?id=2056337) (OOPS!) 3. `oc mirror` mirroring from any catalog type to local filesystem and want to preserve filesystem hierarchy [(4)](#bib4) #### add bundle to catalog 1. create or extract catalog 2. generate FBC contribution from new bundle 3. replace matching contribution in catalog with new contribution (file or blob) 4. build/tag/publish catalog [creating-catalogs](#creating-catalogs) #### update catalog with new bundle info 1. [add bundle to catalog](#add-bundle-to-catalog) #### deprecate bundle 1. [create catalog](#creating-catalog) or [extract catalog from image](#extract-catalog-from-image) 2. delete relevant contributions from the extracted catalog blob or hierarchy 3. build/tag/publish catalog [creating-catalogs](#creating-catalogs) #### delete bundle - as [deprecate bundle](#deprecate-bundle) ### legacy command replacements in terms of common operations ##### `opm index add` - [add bundle to catalog](#add-bundle-to-catalog) ##### `opm index prune` - [delete bundle](#delete-bundle) ##### `opm migrate` - [extract catalog from image](#extract-catalog-from-image) ##### `opm deprecatetruncate` - [delete bundle](#delete-bundle)