MODX Community

How to change a context key

I just wanted to post this here for anyone trying to figure out how to change a context key. Thanks to @theuros for sharing this list with me!

1. `*UPDATE* modx_context          **SET**   `key`       = 'web-en'  **WHERE**   `key`       = 'web2';`
2. `*UPDATE* modx_access_context      **SET**   `target`     = 'web-en'  **WHERE**   `target`     = 'web2';`
3. `*UPDATE* modx_access_media_source    **SET**   `target`     = 'web-en'  **WHERE**   `target`     = 'web2';`
4. `*UPDATE* modx_access_category      **SET**   `context*_*key`  = 'web-en'  **WHERE**   `context*_*key`  = 'web2';`
5. `*UPDATE* modx_access_elements      **SET**   `context*_*key`  = 'web-en'  **WHERE**   `context*_*key`  = 'web2';`
6. `*UPDATE* modx_access_resources     **SET**   `context*_*key`  = 'web-en'  **WHERE**   `context*_*key`  = 'web2';`
7. `*UPDATE* modx_access_resource_groups  **SET**   `context*_*key`  = 'web-en'  **WHERE**   `context*_*key`  = 'web2';`
8. `*UPDATE* modx_access_templatevars    **SET**   `context*_*key`  = 'web-en'  **WHERE**   `context*_*key`  = 'web2';`
9. `*UPDATE* modx_context_setting      **SET**   `context*_*key`  = 'web-en'  **WHERE**   `context*_*key`  = 'web2';`
10. `*UPDATE* modx_media_sources_contexts  **SET**   `context*_*key`  = 'web-en'  **WHERE**   `context*_*key`  = 'web2';`
11. `*UPDATE* modx_media_sources_elements  **SET**   `context*_*key`  = 'web-en'  **WHERE**   `context*_*key`  = 'web2';`
12. `*UPDATE* modx_context_resource     **SET**   `context*_*key`  = 'web-en'  **WHERE**   `context*_*key`  = 'web2';`
13. `*UPDATE* modx_site_content       **SET**   `context*_*key`  = 'web-en'  **WHERE**   `context*_*key`  = 'web2';`
2 Likes