For aEM developers facing hundreds of identical changes
Replace Log4j 1, Commons Lang 2 and old OSGi configs across an AEM codebase
Surge Migrate rewrites five common AEM patterns with deterministic codemods, no AI involved: Commons Lang 2 to 3, Log4j 1 to SLF4J, OSGi configs to .cfg.json, CQ XSS to Sling XSS and CQ Workflow to Granite Workflow. Each opens as its own pull request with notes on what to check.
The problem
These changes are simple but everywhere. Doing them by hand across bundles takes weeks, invites copy-paste mistakes, and produces one giant diff nobody wants to review.
What to know first
Log4j 1 and Commons Lang 2 were common in AEM 6.x projects but are not available on AEM as a Cloud Service, and OSGi configurations must be JSON files with the .cfg.json extension there. The CQ XSS and CQ Workflow APIs have Sling and Granite replacements. Because each of these changes follows a fixed rule, a program can make it exactly the same way in every file, which is what a deterministic codemod is.
How to do it in Surge Migrate
- Find every occurrence. Run the readiness scan on a zip of the repository. Each pattern appears as a finding with its file count, sample lines and automatability marked high.
- Create your free account and a project. Press Start free, enter your work email and open the one-time link (there is no password). Name your workspace, then start a project and pick the service and how you want to work. Your first 3 months are free.
- Connect the repository. Connect GitLab, Bitbucket Cloud or Azure DevOps with an access token stored encrypted.
- Open the codemod pull requests. Press the button to open automatic fixes. Each codemod gets its own dated branch and pull request, so each diff covers one pattern only.
- Review and merge. Read the notes in each pull request, run your tests, merge. Files that use two conflicting APIs are left for review rather than rewritten.
What you get
- Exact, repeatable rewrites with no AI
- One pull request per pattern
- Notes on what each change did
- Ambiguous files flagged instead of guessed
When Surge Migrate is not the right tool
Patterns that need judgement, such as Felix SCR annotations or Guava types in public APIs, are not codemods: they are drafted on our AI server and reviewed by an engineer, or planned as cross-file changes.
Questions
Is AI used for these five rewrites?
No. They are deterministic codemods: the same input always gives the same output.
What about Guava and Felix SCR?
Those go to our private AI server with deterministic checks, then an engineer reviews. Guava types in public signatures are planned as cross-file changes.
Will it change our main branch?
No. Pull requests are opened on their own branches; your team merges.
Read next
- Fix Cloud Manager builds failing on removed or deprecated APIs
- Migrate AEM without sending your code to a third-party AI
- Service users and repoinit: replacing admin sessions properly
- Sling Jobs vs schedulers vs listeners on AEM as a Cloud Service
- Surge Migrate vs your own team with Adobe's free tools
- Pricing: free for 3 months, then at cost
Try it on your own code
The readiness scan is free and needs no account. The portal is free for your first 3 months.
Last updated 1 November 2026 · by Venu Gopal Reddy Muvva, founder