Production exports require a different upgrade approach because they are self-contained deployment bundles with independent configurations. Follow these steps to upgrade production exports:

  1. Move to the timestamped production export directory for the target profile:
    Set-Location $env:OEMCP_HOME
    
    # Navigate to production export directory
    # Replace with actual timestamped directory name
    Set-Location 'exports\export_<profile>_<timestamp>'
    Note: This command selects the first matching export. If you have multiple exports for the same profile, specify the exact directory explicitly.
  2. Stop the running container and back up the export compose file:
    # Stop and back up
    .\run.ps1 stop -Port <port> -Name <container-name>
    Copy-Item 'docker-compose.mcp.yml' 'docker-compose.mcp.yml.backup'
  3. Confirm the export does not include disallowed private credentials:
    # Verify production secret handling
    Test-Path 'sa\private.pem'  # Expected: False
    Test-Path 'sa\sa.jwt'       # Expected: False
    Test-Path 'sa\public.pem'   # Expected: True
  4. Load the target images:
    # Load new images and start
    Set-Location $env:OEMCP_HOME
    .\load_images.ps1
    Note: This procedure assumes that the OpenEdge MCP Server distribution is available on the production machine.
  5. Restart the production export with the upgraded image:
    # Start the upgraded container
    Set-Location 'exports\export_<profile>_<timestamp>'
    .\run.ps1 start -Port <port> -Name <container-name>
  6. Verify the container image and runtime status:
    # Verify container uses the upgraded image
    $ContainerImageId = docker inspect --format '{{.Image}}' <container-name>
    $ExpectedImageId = docker image inspect openedge-mcp-server:latest --format '{{.Id}}'
    
    if ($ContainerImageId -eq $ExpectedImageId) {
        Write-Host "✓ Container is using the upgraded image" -ForegroundColor Green
    } else {
        Write-Host "✗ WARNING: Container image mismatch" -ForegroundColor Red
        Write-Host "  Container: $ContainerImageId"
        Write-Host "  Expected:  $ExpectedImageId"
    }
    # Check runtime status
    .\run.ps1 status -Port <port> -Name <container-name>
    
    Verify that externally managed credentials can list and invoke authorized tools. Production bundles must never receive copied development credentials.