Don’t Upgrade Ubuntu Until You Read This!
Sandeep Gokhale
6 mins
August 12th, 2025
Background
Earlier this year, for one of the clients me and my company are working with, the cloud servers were running on Ubuntu 20.04 LTS (Focal Fossa), running java (For Spring Boot), Maven, Node.js, PostgreSQL, SSL certificates, and GitHub Actions.
By May 2025, the long term support of 20.04 LTS (Focal Fossa) was ending and we needed to migrate to another LTS. Ubuntu had a couple of options: Uplift to Ubuntu 22.04 (Jammy Jellyfish) or a much higher version.
Research
After a detailed research into which Operating System was correct for us, supporting the versions we need and making sure the the future tools we have in mind to implement will also work, a decision was made to go with Ubuntu 22.04 (Jammy Jellyfish).
Migrate from Ubuntu 20.04 to 22.04
Ubuntu 20.04 LTS, while still supported until April 2025, Ubuntu 22.04 LTS brought several compelling advantages:
- Standard support until 2027, Extended support lifecycle until April 2032.
- Enhanced security features including improved AppArmor profiles and kernel hardening
- Performance improvements with better hardware support and optimized resource management
- Updated package repositories with newer versions of critical software
- Better containerization support for our Docker and Kubernetes workloads
Goals of the migration
When you upgrade your operating system, you’re making a decision that impacts application stability, security, and business continuity.
Our goals were simple:
- Smallest Downtime – Users should not be impacted.
- Minimal to Zero Risks – Controlled Execution.
Planning
With a detailed research already completed, we created a clear migration plan. The focus was to understand:
- What changes are coming with 22.04?
- Which dependencies might break?
Key steps in our planning:
- Inventory of services – Java, Node.js, Postgres, certificates, automation pipelines.
- Dependency mapping – List all packages and their versions to identify upgrade risks.
- Compatibility checks – Ensure frameworks and databases are fully supported on Ubuntu 22.04.
- Data Backup – Took necessary backup of the data alone and move to another safe place.
- Rollback plan – EC2 snapshot ready just in case.
- Information – Keep the team Informed about the activities being done.
Risks while migrating Ubuntu 20.04 to 22.04
All migrations will come with its own risk. This is where Research, Planning, Identifying Risks and mitigating them will be key.
Risk management is all about Anticipating and identifying the problems before they occur and having a plan of action to overcome the risk by keeping a couple of solutions ready.
Identifying Potential Risks
We identified several categories of risk that required specific mitigation strategies:
- Data Loss Risks: Complete system backups were mandatory before any migration attempt. We implemented automated backup verification to ensure recovery capabilities.
- Compatibility Issues: Legacy applications and custom configurations posed the highest risk. We created detailed compatibility matrices and prepared alternative solutions.
- Security Vulnerabilities: The migration process itself could introduce temporary security gaps, requiring additional monitoring and protection measures.
This proactive planning meant no surprises on migration day. With the risks clear, we wanted to identify the best strategy to migrate Ubuntu 20.04 to 22.04 that works for us.
Migration Strategies
We looked at a couple of migration strategies
- Take a snapshot and migrate the actual server but in this case, there would be a downtime even if we did this on a weekend.
- Use the snapshot to spin another EC2, and migrate this newly created EC2 while leaving the actual server as it is. With this approach, there wont be any downtime for users and also no risks with the main server.
We decided to go with the second option.
Step-by-Step Migration Approach
Our principle was to play with the snapshot before making the changes directly to the server. Here are the exact steps we did.
High level steps
- Spin an EC2 from the snapshot for trial migration.
- Run full system updates before release upgrade.
- Verify Path variables.
- Make sure all the data/frameworks/tools/libraries and CICD are compatible and working.
- Verify Data and its integrity.
- Validate Firewall Settings and other security controls in place.
- Locally run the application and ensure its fine.
- Capture evidence as necessary
- Once Confident, repeat the same steps on the actual server.
Detailed Steps
Below is the sequence of commands we used.
Note: Some commands that are specific to the project are left out intentionally.
# Since you have an snapshot, you dont have to worry – Treat this machine as a throwaway.
# Login to the server.
# Stop services like database, nginx, apache and others you may have.
# Now you are ready to start.
1. sudo apt update && sudo apt upgrade
2.sudo apt list –upgradable
3.sudo do-release-upgrade #This will show few prompts to accept, continue, Yes/No. Select Accordingly.
# Restart the machine and relogin
# Verify if the version is now 22.04
# Verify if the data is fine and services start correctly.
# Verify if the security is good and firewall settings are fine.
# Run the applications and make sure they are working
# Verify CI/CD
# There are some more things but they were just project specific
We were finally successful in our Third attempt and after this, we documented the process with screenshots and key commands.
The Real Migration
With detailed documentation and screenshots and the experience of doing it 3 times, there were no surprises when the actual server was migrated and everything worked in the very first attempt.
We repeated the same checks as this was the key server and ensured we are all secure and safe and called the migration complete/successful and informed the stake holders.
The real migration
Lessons
We were successful at the third attempt and got everything working how we want. Here are some lessons we learnt.
- Strategy: Our Strategy was perfect. We failed two times during the migration process with different errors (cannot share the specifics here). If we had done this directly on the actual server, it would have been a disaster.
- Services: If you have a database(PostgreSQL or MongoDB etc), version compatibility could happen. At the middle of the migration, you will be forced to install a newer version of the same DB, even though you do not want it. So, before starting the migration, Its better to either stop the service or sometimes even uninstall it. Post successful Migration, Enable or Install the DB again.
- Version Control: Its important to fix/pin your versions so that during migration, Ubuntu will not force you to migrate to a newer version or install it without asking you.
- Communicate: We were continuously keeping the team and stakeholders informed after reaching key milestones.
Upgrading from Ubuntu 20.04 to 22.04 isn’t just a command-line operation. it’s a strategic infrastructure decision. When done right, it brings performance gains, better security, and long-term support.


