This guide will provide steps for migrating from version contexts to search contexts on your private Sourcegraph instance.
- This document assumes that you have already configured version contexts in your site configuration.
- Search contexts and search context management are enabled in global settings.
Site admins can enable search contexts on private Sourcegraph instances in global settings using the following:
"experimentalFeatures": {
"showSearchContext": true,
"showSearchContextManagement": true
}
Note: While version contexts are located in the site configuration, search contexts are enabled through the global settings.
Reload after saving changes to see search contexts enabled.
- Log in to your private Sourcegraph instance as a site admin.
- Navigate to
https://your_sourcegraph_instance.com/contexts
. - Press
Convert version contexts
. A list of existing version contexts found in the site configuration will be shown. - Convert either all version contexts at once, or specific individual version contexts as desired.
- Navigate back to
https://your_sourcegraph_instance.com/contexts
. Converted version contexts will be listed.
Converted search contexts can be used immediately by users on the Sourcegraph instance. The contexts selector will be shown in the search input.
Once desired existing version contexts have been converted into search contexts, we recommend discontinuing use of version contexts.
To discontinue use of version contexts:
- Navigate to your site configuration.
- Locate
experimentalFeatures.versionContexts
in the site configuration, and remove theversionContexts
object and all of its contents. - Save changes.
After removing version contexts from the site configuration, reload the page. The version contexts UI dropdown will no longer be shown in the search input.
Note: Once version contexts are removed from site configuration, they will no longer be available for use or conversion into search contexts.