How to migrate from legacy environment management to Onboardbase?

How to migrate from legacy environment management to Onboardbase?

Are you tired of managing environment variables and secrets using outdated and error-prone methods such as hardcoding them into your code or relying on unsecured .env files?

If so, it might be time to consider migrating to Onboardbase, an all-in-one SecretOps infrastructure for securing environment configs and secret credentials across all stages of your development process.

In this blog post, we'll explore the benefits of Onboardbase and provide a step-by-step guide on how to migrate from your legacy environment management system to Onboardbase.

Why Migrate to Onboardbase?

Onboardbase provides a more secure and streamlined way of managing environment variables and secrets. With Onboardbase, you can store all your configuration data securely in a centralized location and access it using APIs, SDKs, or the Onboardbase CLI. This means you can easily manage environment variables and secrets across all your development stages, from local development to production, without the risk of exposing sensitive data.

Here are some of the benefits of migrating to Onboardbase:

  1. Increased Security: With Onboardbase, you can secure your environment variables and secrets using advanced encryption methods. This ensures that only authorized personnel can access sensitive data, reducing the risk of data breaches and other security incidents.

  2. Simplified Management: Onboardbase provides a simple and intuitive dashboard that allows you to manage all your configuration data in one place. You can easily create, edit, and delete environment variables and secrets, as well as set up permissions and access controls for your team.

  3. Improved Collaboration: Onboardbase allows you to collaborate securely with your team members, sharing access to configuration data only with those who need it. This improves team collaboration and reduces the risk of unauthorized access or accidental exposure of sensitive data.

Now that you know the benefits of Onboardbase, let's dive into how to migrate from your legacy environment management system to Onboardbase.

Step 1: Identify Your Environment Variables and Secrets

The first step in migrating to Onboardbase is to identify all your environment variables and secrets. This includes variables such as database URLs, API keys, passwords, and other sensitive data that you're currently managing through your legacy environment management system.

Once you have identified your environment variables and secrets, you can start organizing them based on their respective applications, environments, and scopes. This will help you to create a logical structure for your configuration data in Onboardbase.

Step 2: Create an Onboardbase Account

The next step is to create an account with Onboardbase. You can sign up for a free trial or choose from one of the available pricing plans based on your needs. Once you have created an account, you can log in to the Onboardbase dashboard and start creating your first organization.

Step 3: Set Up Your Organization and Projects

In the Onboardbase dashboard, you can create one or more organizations, each containing multiple projects. Organizations allow you to group related projects together and manage access controls and permissions for your team members. Projects represent your actual applications or platforms and contain the environment variables and secrets that are specific to each project.

Once you have created an organization, you can create a new project by clicking on the "New Project" button. Follow the instructions to create your first project and define its name, description, and environment variables.

Step 4: Migrate Your Environment Variables and Secrets to Onboardbase

Now that you have set up your Onboardbase account, installed the CLI or SDK, and updated your codebase, it's time to migrate your environment variables and secrets to Onboardbase.

Migrating from a legacy environment management system to Onboardbase may seem daunting, but it can be straightforward with the right approach. Here's a step-by-step guide to help you through the process.

Step 1: Identify Your Environment Variables and Secrets

The first step in migrating to Onboardbase is identifying the environment variables and secrets you need to migrate. Go through your codebase and list down all the environment variables and secrets you are currently using.

Step 2: Create a List of Environment Variables and Secrets in Onboardbase

Create a list of environment variables and secrets you identified in Step 1 in your Onboardbase dashboard. To do this, go to the Secrets tab and click on "Add Secret." Add each environment variable or secret name, its value, and any relevant metadata, such as the environment it belongs to and any additional notes or descriptions.

Step 3: Update Your Code to Use Onboardbase Secrets

Once you have created a list of your environment variables and secrets in Onboardbase, you need to update your code to use them. Use the Onboardbase SDK or CLI to fetch the secrets and environment variables from Onboardbase.

For example, if you're using the Onboardbase JavaScript SDK, you can use the following code to fetch a secret:

const onboardbase = require('@onboardbase/sdk');

onboardbase.getSecret('MY_SECRET_NAME')
  .then(secretValue => {
    // Use the secret value
  });

If you're using the Onboardbase CLI, you can use the following command to fetch an environment variable:

onboardbase run --env MY_ENV_VARIABLE_NAME

Now that you have updated your code to use Onboardbase secrets, it's time to migrate your existing environment variables and secrets to Onboardbase.

To do this, update your CI/CD pipeline to use Onboardbase to fetch your environment variables and secrets instead of your previous environment management system. This may require modifying your pipeline configuration files, such as your GitLab CI/CD .gitlab-ci.yml or your CircleCI config.yml file.

Ensure that your pipeline is configured to fetch the secrets and environment variables from Onboardbase for each environment, such as production, staging, and development.

Configurations

Control how Onboardbase CLI interacts with your project's secrets.

Onboardbase has some configurations for ease of use. It accounts for your needs based on how your team works.

  • .onboardbase.yaml - A setup configuration file that can exist at the root of a project.

  • When you run the onboardbase setup command and select an organization, a project, and an environment, an .onboardbase.yaml is created for you in the current directory.

  • This is a local configuration file with the value you specified in the setup process.

    Aside from using the setup command to create it - which we believe is the most convenient, you can explicitly create the file to bypass the setup process.

A complete .onboardbase.yaml setup file:

setup:
  project: frontend-marketing
  environment: development
  prefix: REACT_APP
secrets:
  local:
    - DATABASE_URL: 2314
    - SSH: |
        -----BEGIN OPENSSH PRIVATE KEY-----
        b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
        NhAAAAAwEAAQAAAYEAsEPa5nGQh+f6+ixqs==
        -----END OPENSSH PRIVATE KEY-----

What you will learn to customize

Step 5: Test Your Updated Pipeline

Once you have migrated your environment variables and secrets to Onboardbase and updated your pipeline configuration files, it's time to test your updated pipeline.

Run a build and deploy your application to each environment and ensure that the application is running correctly. Verify that your application can fetch the necessary secrets and environment variables from Onboardbase.

Step 6: Clean Up Legacy Environment Management

Finally, once you have confirmed that your updated pipeline is working correctly, it's time to clean up your legacy environment management system. Remove any environment variables and secrets from your previous system and update your pipeline configuration files to remove any references to them.

Conclusion

Migrating from a legacy environment management system to Onboardbase can be a significant undertaking, but it can also be a valuable investment in your team's productivity and security.

By following the steps outlined in this guide, you can smoothly migrate your environment variables and secrets to Onboardbase and reap the benefits of a centralized, secure, and easy-to-use environment management system.

Try Onboardbase!

Did you find this article valuable?

Support Rahul Khinchi by becoming a sponsor. Any amount is appreciated!