A Singapore Government Agency Website

Airbase V1 to V2 Migration Guide

Why should I migrate from Airbase V1 to V2?

1. Extended support for more languages

Airbase V2 introduces support for containerized workloads, enabling the deployment of applications written in a wider range of languages such as Go, Python, and Next.js.

2. Access to the latest updates

With V2, you’ll receive the most recent updates and technical support directly from the Airbase team, ensuring optimal performance and reliability.

3. Seamless migration process

Transitioning from V1 to V2 is straightforward. Most functionalities and commands remain unchanged, and with a guided step-by-step process written below, you can migrate quickly and confidently.

How do I migrate from V1 to V2?

1. Docker Installation

As Airbase V2 deploys containerized workloads, you’ll need to have Docker installed in your local machine.

  • Install either of the supported options for Docker Installation

Note: Ensure Docker Daemon is running before executing subsequent steps.

2. Upgrade Airbase CLI

Use the following command:

sudo npm remove --global @airbase/airbase-cli && sudo npm install --global @airbase/airbase-cli@containers

3. Verify that Airbase CLI has been updated to the correct version

Use the following command:

airbase --version

The expected output will be 3.0.0-beta.13. If the output is 2.XXX, please ensure that the earlier step has been carried out correctly.

4. Re-login into Airbase CLI

Use the following command:

airbase login

Visit the link with a web browser to complete the authentication process.

5. Create Dockerfile in the directory

Step-by-Step Walkthrough:

  • For example, using a NextJS Standalone App deployed on Airbase V1: https://lol1.app.airbase.sg

  • Code snippet to include for DockerFile if deploying a NextJS Standalone App

    FROM gdssingapore/airbase:node-22-builder AS builder
    ENV NEXT_TELEMETRY_DISABLED=1
    ENV SKIP_ENV_VALIDATION=1
    COPY package.json package-lock.json ./
    RUN npm install
    COPY . ./
    RUN npm run build
    
    FROM gdssingapore/airbase:node-22
    RUN mkdir .next && chown app:app .next
    RUN mkdir .npm && chown app:app .npm
    COPY --from=builder --chown=app:app /app/.next/standalone ./
    COPY --from=builder --chown=app:app /app/.next/static ./.next/static
    COPY --from=builder --chown=app:app /app/public ./public
    USER app
    CMD ["node", "server.js", "--port", "$PORT"]

Note: This step will not be necessary for NextJS Standalone apps in the future, as it will be able to support building of container images for NextJS standalone app without an explicit DockerFile.

6. Remove airbase.json file in the working directory

Use the following command:

rm airbase.json

7. Build container image for Airbase

Use the following command:

airbase container build

8. Deploy application

Use the following command:

airbase container deploy

The app has been successfully deployed on: https://migration1.app.tc1.airbase.sg.

Note: The generated URL in V2 has an additional tc1 in the URL path, hence V1 users are recommended to take this into consideration for other functionalities (e.g automated tests, documentation references) that may be referring to the old URL.

When should I migrate to V2 by?

V1 will be officially deprecated by 31 July 2025. To ensure continued support and uninterrupted service on the Airbase platform, please complete your migration to V2 before this date.

Assumptions

  • This guide does not cover changes to existing Github CI yaml configurations that incorporate Airbase CLI commands for build and deploy.
  • For advanced usage of GitLab CI pipelines, please refer to documentation at https://console.v2.airbase.sg/docs/integrations/sgts-gitlab to setup base, after which you may want to add your custom CI jobs to complete the pipeline.
Chat with me!
Bot Launcher