Migration from Amazon Linux 2 to Amazon Linux 2023 - AWS Elastic Beanstalk

Migration from Amazon Linux 2 to Amazon Linux 2023

This topic provides guidance to migrate your application from an Amazon Linux 2 platform branch to an Amazon Linux 2023 platform branch.

Differences and compatibility

Between the Elastic Beanstalk AL2 and AL2023 platforms

There is a high degree of compatibility between Elastic Beanstalk Amazon Linux 2 and Amazon Linux 2023 platforms. Although there are some differences to note:

  • Instance Metadata Service Version 1 (IMDSv1) – The DisableIMDSv1 option setting defaults to true on AL2023 platforms. The default is false on AL2 platforms.

  • pkg-repo instance tool – The pkg-repo tool is not available for environments running on AL2023 platforms. However,you can manually apply package and operating system updates to an AL2023 instance. For more information, see Managing packages and operating system updates in the Amazon Linux 2023 User Guide.

  • Apache HTTPd configuration – The Apache httpd.conf file for AL2023 platforms has some configuration settings that are different from those for AL2:

    • Deny access to the server’s entire file system by default. These settings are described in Protect Server Files by Default on the Apache website Security Tips page.

    • Stop users from overriding security features you've configured. The configuration denies access to set up of .htaccess in all directories, except for those specifically enabled. This setting is described in Protecting System Settings on the Apache website Security Tips page. The Apache HTTP Server Tutorial: .htaccess files page states this setting may help improve performance.

    • Deny access to files with name pattern .ht*. This setting prevents web clients from viewing .htaccess and .htpasswd files.

You can change any of the above configuration settings for your environment. For more information, see Extending Elastic Beanstalk Linux platforms. Expand the Reverse Proxy topic to see the Configuring Apache HTTPD section.

Between the Amazon Linux operating systems

For more information about the differences between the Amazon Linux 2 and Amazon Linux 2023 operating systems, see Comparing Amazon Linux 2 and Amazon Linux 2023 in the Amazon Linux 2023 User Guide.

For more information about Amazon Linux 2023, see What is Amazon Linux 2023? in the Amazon Linux 2023 User Guide.

General migration process

When you're ready to go to production, Elastic Beanstalk requires a blue/green deployment to perform the upgrade. The following are the general best practice steps that we recommend for migration with a blue/green deployment procedure.

Preparing to test for your migration

Before you deploy your application and start testing, review the information in the prior section Differences and compatibility. Also review the reference cited in that section, Comparing Amazon Linux 2 and Amazon Linux 2023 in the Amazon Linux 2023 User Guide. Make a note of the specific information from this content that applies or may apply to your application and configuration set up.

High level migration steps
  1. Create a new environment that's based on an AL2023 platform branch.

  2. Deploy your application to the target AL2023 environment.

    Your existing production environment will remain active and unaffected, while you iterate through testing and making adjustments to the new environment.

  3. Test your application thoroughly in the new environment.

  4. When your destination AL2023 environment is ready to go to production, swap the CNAMEs of the two environments to redirect traffic to the new AL2023 environment.

More detailed migration steps and best practices

For a more detailed blue/green deployment procedure, see Blue/Green deployments with Elastic Beanstalk.

For more specific guidance and detailed best practice steps, see Blue/Green method.

More references to help plan your migration

The following references can offer additional information to plan your migration.