# Copy, promote, or restore assets

To make implementation, maintenance, or troubleshooting smoother, you might want to <u>copy</u>, <u>promote</u>, or <u>restore</u> an asset. These actions save you manual rework when you want to use an existing asset as a base and either reuse or tweak from there.

You can copy and promote assets individually or in bulk.  

## Definitions

An <u>**asset**</u> is a key building block of your integration. [Learn more about assets](/basics/managing-access-for-your-redox-organization/what-are-assets).

One asset type is a <u>**data operation**</u> (an individual step during log processing), like a <u>config modifier</u>, <u>filter</u>, or <u>translation set</u>. [Learn about Redox data operations](/basics/data-exchange-with-redox/operations-for-data-processing).

## Prerequisites

- All environment users can view assets (filters, translation sets, config modifiers). However, a user must be assigned to an <u>**engineer**</u> or a <u>**support**</u> role to manage them. [Learn about user roles](/basics/managing-access-for-your-redox-organization/what-are-user-roles-and-groups).
- You must have the appropriate user role _in each environment_ to perform actions across environments (i.e., promote from staging to production, copy across environments, or compare staging and production subscriptions). 

## Choose which action to take

|  | **Copy** | **Promote** | **Restore** |
| --- | --- | --- | --- |
| Best for | Using existing logic as a base to create a new, independent asset. | Testing and verifying an asset in staging before pushing to production.  Troubleshooting a live issue in staging before pushing to production to resolve. | Troubleshooting a live issue by reverting to a previous version that worked. |
| Creates association between two assets | No | Yes | No |
| Environment type | Any | Staging to production only | Any |
| Available with bulk actions | Yes | Yes | No |

## View operation assets

1. Log in to the Redox dashboard.
2. From the navigation menu, click the **Operations** drop-down.
3. The Operations options expand. Click the **operation type** you want to review.
4. For config modifiers and filters, a list of relevant assets displays. For translation sets, review value sets by default or click the **Translation set** tab to review translation set assets. 
5. Search for or use the filters to narrow down the list of assets. Or, click the **subscription link** to expand and view link details.
6. To review a specific asset, click anywhere in its **row** to open the <u>Details</u> page. 

## Copy an individual asset

Copy an asset to use existing logic as a base when creating a new asset. You can copy assets within the same environment or across environments. 

Copying an asset doesn’t create an association between the two assets. That means edits to one won’t affect the other. 

1. Follow the steps to view the asset type you want to copy.
2. On the asset row, click the **three-dots** icon, then click the **Copy** option.
3. A modal opens. Enter the following details:
   1. In the <u>Name</u> field, enter a **new name** or keep the default name with <u>(copy)</u> appended. 
   2. Under <u>Copy to environment</u>, select the **environment** you want to copy to. You can copy within the same environment or across environments. Remember that links don’t copy over.


> **Environment access and roles**
>
> Only environments you have access to with an <u>engineer</u> or <u>support</u> role will appear.
>
> If you only have access to the current environment, you won’t see the <u>Copy to environment</u> option at all. 


4. Click the **Copy** button.
5. If you selected the same environment, the new asset appears in the table. Otherwise, navigate to the environment you selected to see the new asset.

## Promote an individual asset

You might want to promote a config modifier, translation set, or filter when testing before go-live or troubleshooting a live production issue. 

First, build and test the asset in a staging environment. Then, instead of manually rebuilding it in production, you can promote the tested asset to save time and avoid introducing errors when rebuilding across environments. 

> **What's not promoted**
>
> When you promote an individual asset, any subscription links in staging won’t carry over to production. You have to add and manage links in each environment separately. 
>
> However, you have the option to add production links when bulk promoting multiple assets. 

Promoting an asset creates an <u>association</u> between the staging and production assets. You’ll see a <u>**synced**</u> label when the staging asset matches the production asset. A <u>**differs**</u> label appears if the staging and production versions have different settings or links. 

1. Follow the steps to view the asset type you want to promote or re-promote.
2. Make sure you’re in a **staging** environment.
3. Find the asset you want to promote and click anywhere in its **row**.
4. The <u>Details</u> page opens. Click the **Promote** button.
5. A modal opens to confirm what you’re promoting. Review the asset name, version, and status. 
6. (Optional) Click **Add link** to apply to a production subscription right away. This option is only available when promoting the first time, not when re-promoting an asset. 
   1. Use the search bar or subscription filters to narrow down the list, if needed. 
   2. Select a **production subscription** from the list. 
   3. _For config modifiers and translation sets_, the field path and processing location are populated from existing staging links, when possible. If not, the additional fields appear. Select the **field path** or **processing location**. 
7. After reviewing, click the **Promote** button. If you added a link, the promoted asset immediately applies to production traffic. 

> **Translation set note**
>
> When you promote a translation set, the value set is automatically promoted, too. Value sets can’t be promoted on their own.


8. A successful message appears. 
9. (Optional) Click the **View in production** button to navigate to the promoted asset. From the production asset’s <u>Details</u> page, add new or more subscription links. 

### Edit a promoted asset

There are a couple of differences with editing or deleted a promoted asset. 

- You must edit a promoted asset in <u>staging</u>. 
- You must delete a promoted asset in <u>production</u> first. Then, you can manage the <u>staging</u> asset independently or delete it. 

1. To edit a promoted asset, navigate to the <u>staging</u> environment. 
You can do this with the <u>Environment</u> drop-down, or you can click the **Go to Staging** button on the <u>Details</u> page of the production asset. 
   1. If navigating from the <u>Details</u> page, a confirmation modal opens to acknowledge that you want to switch environments. Click the **Proceed** button to continue.
2. On the <u>Details</u> page in the staging environment, follow the instructions to edit the relevant asset type:
   1. [translation set](https://docs.redoxengine.com/permalink/4GJXunyoAI3s05VrrRkJ09/#edit-a-translation-set)
   2. [filter](https://docs.redoxengine.com/permalink/Zn8kiEw3GdyBFaSwQNSAN/#edit-a-filter)
   3. [config modifier](https://docs.redoxengine.com/permalink/6sZ0Y9XdnMRCyoSWlqscjM/#edit-a-config-modifier)
3. Once changes are successfully made, re-promote the asset to keep it in sync across environments.  
4. Also, make sure you have created subscription link(s) to apply the asset in your production environment.  

## Compare a subscription’s linked assets

You can view and compare a subscription’s linked assets. This is helpful: 

- before performing any bulk actions
- when managing promoted assets to compare staging and production versions

1. Log in to the Redox dashboard.
2. From the navigation menu, click the **Connections** option.
3. Open a subscription's settings from either tab. 
   - <u>Connected orgs</u> tab:
     1. Click a **connection** tile. 
     2. Find the **subscription arrow** you want to review, then click the **Settings** link. 
   - <u>All subscriptions</u> tab: 
     1. Click the **subscription row** you want to review. 
4. The <u>Details</u> page opens. Review the subscription details, including the source, destination, and linked asset details. the <u>Linked assets</u> section shows all operations that have been linked to this subscription.
5. In a <u>staging</u> environment, click the **Select subscription** button to compare a staging and production subscription's assets.
6. A modal opens. Click the **radio button** of the production subscription you want to compare. 
7. Click the **Select** button.
8. A table appears with the linked assets with the <u>status</u>, which tells you the comparison:
   - <u>Synced</u>: This asset exists in staging and production and match in their settings.
   - <u>Differs</u>: This asset exists in staging and production but the settings or links vary. Click the **View diff** option to review the setting or link details and why they’re different. 
   - <u>Missing</u>: This asset exists only in staging or production, not both environments.
9. To clear the selected subscription, click the **X** on the subscription name. Then repeat the steps to select another. 

## Bulk copy, promote, or link assets

In a staging environment, you can action on multiple assets at once. You can do one or a combination of the following: 

- promote asset(s) for the first time
- re-promote newer version(s)
- link promoted asset(s) to production subscription(s)
- copy staging asset(s) to production

Available actions for each asset are determined by the state they’re in. For example, bulk actions aren’t available if:

- an asset only exists in production, not in staging.
- the staging and promoted assets are already in sync.

1. Follow the steps to compare a subscription’s linked assets.
2. Check the **boxes** of the assets you want to bulk action on. Or, click the **Select all** box to action on all the linked assets in the compare view. 
3. Click the **Promote X changes** button. 
4. A modal opens with the available bulk actions for each selected asset. Select any of the available options from the <u>Action</u> drop-down fields:
   - **Promote** the staging asset to production. 
   - **Promote and link** to also link the promoted asset to the selected production subscription. 
   - **Copy** the staging asset’s logic to create a new, independent asset in the selected production subscription.
   - **Copy and link** to also link the new asset to the selected production subscription.
5. Once finished, click the **Promote X changes** button. Or click the **Cancel** button to discard the changes. 
6. A summary of the completed changes appears (e.g., 1 copied, 3 linked). 
To view the production assets, click the **View in production** button. 
To copy, promote, or link the staging assets to another production subscription, click the **X** on the subscription name or the **Change subscription** button.

## Restore an asset

Every time you edit an asset, you create a new version of it. You can restore a version that’s not currently in use. This can be helpful when troubleshooting to see where an error might have been introduced or to resolve an error by using a version that worked previously.

1. Follow the steps to view the asset type you want to restore.
2. Find the asset you want to restore and click anywhere in its **row**.
3. The <u>Details</u> page opens. Click the **Restore** button.
4. A modal opens. From the drop-down, select a **version** to restore. 


> **Restore notes**
>
> Restoring means activating a version that’s not in use. That means you can go backwards or forwards a version. 
>
> Keep in mind you can’t restore a version that’s already in use or an asset that’s been deleted. 

 
5. The diff view shows what’s different between the current and selected version. Review the differences, then click the **Restore** button. 


> **Versions after editing**
>
> If you edit an asset after restoring a previously used version, a new version is created.
>
> For example, let’s say you were on version 3 and you restore version 2. Then you make and save edits to version 2. This creates version 4 of the asset. At that point, you can still restore to version 3 at any time.


6. For promoted assets, restoring a version only applies to the current environment. If you restore a version in staging, you might need to re-promote the asset if you want to apply it to production as well.


> **What happens to value sets?**
>
> If a restored translation set points to an inactive value set version, the restored translation set will continue to use the inactive value set(s). Translations will still process as defined by the inactive value set(s).
>
> However, once you edit an active translation set, it automatically points to the latest active version of value set(s). In other words, you can’t edit an active translation set with outdated value set(s).


