docs/assets/js/75e64983.6d2f24f4.js
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[7388],{337:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>g,frontMatter:()=>o,metadata:()=>a,toc:()=>l});var i=t(4848),s=t(8453);const o={sidebar_position:4,title:"Upgrading"},r=void 0,a={id:"getting-started/upgrading",title:"Upgrading",description:"COSMOS Upgrades",source:"@site/docs/getting-started/upgrading.md",sourceDirName:"getting-started",slug:"/getting-started/upgrading",permalink:"/docs/getting-started/upgrading",draft:!1,unlisted:!1,editUrl:"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/getting-started/upgrading.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4,title:"Upgrading"},sidebar:"defaultSidebar",previous:{title:"Code Generators",permalink:"/docs/getting-started/generators"},next:{title:"Key Concepts",permalink:"/docs/getting-started/key_concepts"}},c={},l=[{value:"COSMOS Upgrades",id:"cosmos-upgrades",level:3},{value:"Migrating From COSMOS 4 to COSMOS 5",id:"migrating-from-cosmos-4-to-cosmos-5",level:3}];function d(e){const n={a:"a",code:"code",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h3,{id:"cosmos-upgrades",children:"COSMOS Upgrades"}),"\n",(0,i.jsx)(n.p,{children:"COSMOS is released as Docker containers. Since we're using Docker containers and volumes we can simply stop the existing COSMOS application, then download and run the new release."}),"\n",(0,i.jsx)(n.p,{children:"This example assumes an existing COSMOS project at C:\\cosmos-project."}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Stop the current COSMOS application"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-batch",children:"C:\\cosmos-project> openc3.bat stop\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Change the release in the .env file to the desired release"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-batch",children:"OPENC3_TAG=5.1.1\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Run the new COSMOS application"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-batch",children:"C:\\cosmos-project> openc3.bat run\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"migrating-from-cosmos-4-to-cosmos-5",children:"Migrating From COSMOS 4 to COSMOS 5"}),"\n",(0,i.jsxs)(n.p,{children:["COSMOS 5 is a new architecture and treats targets as independent ",(0,i.jsx)(n.a,{href:"/docs/configuration/plugins",children:"plugins"}),". Thus the primary effort in porting from COSMOS 4 to COSMOS 5 is converting targets to plugins. We recommend creating plugins for each independent target (with its own interface) but targets which share an interface will need to be part of the same plugin. The reason for independent plugins is it allows the plugin to be versioned separately and more easily shared outside your specific project. If you have very project specific targets (e.g. custom hardware) those can potentially be combined for ease of deployment."]}),"\n",(0,i.jsx)(n.p,{children:"COSMOS 5 includes a migration tool for converting an existing COSMOS 4 configuration into a COSMOS 5 plugin. This example assumes an existing COSMOS 4 configuration at C:\\COSMOS and a new COSMOS 5 installation at C:\\cosmos-project. Linux users can adjust paths and change from .bat to .sh to follow along."}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Change to the existing COSMOS 4 configuration directory. You should see the config, lib, procedures, outputs directory. You can then run the migration tool by specifying the absolute path to the COSMOS 5 installation."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-batch",children:"C:\\COSMOS> C:\\cosmos-project\\openc3.bat cli migrate -a demo\n"})}),"\n",(0,i.jsx)(n.p,{children:"This creates a new COSMOS 5 plugin called openc3-cosmos-demo with a target named DEMO containing the existing lib and procedures files as well as all the existing targets."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-batch",children:"C:\\COSMOS> C:\\cosmos-project\\openc3.bat cli migrate demo-part INST\n"})}),"\n",(0,i.jsx)(n.p,{children:"This would create a new COSMOS 5 plugin called openc3-cosmos-demo-part with a target named DEMO_PART containing the existing lib and procedures files as well as the INST target (but no others)."}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Open the new COSMOS 5 plugin and ensure the ",(0,i.jsx)(n.a,{href:"/docs/configuration/plugins#plugintxt-configuration-file",children:"plugin.txt"})," file is correctly configured. The migration tool doesn't create VARIABLEs or MICROSERVICEs or handle target substitution so those features will have to added manually."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Follow the ",(0,i.jsx)(n.a,{href:"/docs/getting-started/gettingstarted#building-your-plugin",children:"building your plugin"})," part of the Getting Started tutorial to build your new plugin and upload it to COSMOS 5."]}),"\n"]}),"\n"]})]})}function g(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>a});var i=t(6540);const s={},o=i.createContext(s);function r(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);