{"id":2416,"date":"2026-10-22T13:00:00","date_gmt":"2026-10-22T07:30:00","guid":{"rendered":"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/"},"modified":"2026-11-15T11:29:53","modified_gmt":"2026-11-15T05:59:53","slug":"migrating-visualforce-to-lwc","status":"publish","type":"post","link":"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/","title":{"rendered":"Migrating Visualforce to LWC: A Practical Step by Step Plan"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Migrating Visualforce to LWC is work most Salesforce teams face, because Salesforce builds new features only for Lightning Web Components. The risk is doing it all at once and breaking a page the business depends on. A phased plan avoids that.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This post builds on <a href=\"https:\/\/swapnilzambare.com\/blog\/visualforce-basics-standard-controllers\/\">Visualforce Basics<\/a>, <a href=\"https:\/\/swapnilzambare.com\/blog\/visualforce-custom-controllers-extensions\/\">Custom Controllers<\/a> and <a href=\"https:\/\/swapnilzambare.com\/blog\/lwc-performance-best-practices\/\">LWC fundamentals<\/a>. We will migrate the Bright Path course list.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What does Migrating Visualforce to LWC mean?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Migrating Visualforce to LWC means rebuilding a server rendered page as a browser rendered component. The markup changes from <code>apex<\/code> tags to HTML, the controller becomes static <code>@AuraEnabled<\/code> methods, and view state disappears entirely.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Think of moving house. The furniture is your business logic and it comes with you. The rooms are the markup, and they get rebuilt to a new plan.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Migrating Visualforce to LWC Matters<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Visualforce still runs, so there is no deadline forcing you. However, new platform features, Dynamic Forms, mobile performance and Agentforce components all target LWC.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Migrating Visualforce to LWC also removes the view state limit, which is the single most common cause of errors on old pages. Pages become faster because only data crosses the network, not whole rendered pages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Plan the Migration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Doing it in order keeps production safe.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-diagram-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-diagram-1-1024x640.png\" alt=\"Migrating Visualforce to LWC diagram showing a five step migration order\" class=\"wp-image-2414\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-diagram-1-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-diagram-1-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-diagram-1-768x480.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">A five step order that keeps the old page working.<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Inventory What You Have<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before writing anything, find out what is actually used.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT Id, Name, ApiVersion, IsAvailableInTouch\nFROM ApexPage\nORDER BY Name<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then check usage. Many orgs find a third of their pages are dead and can simply be deleted.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Finding<\/th><th>Action<\/th><\/tr><\/thead><tbody><tr><td>Page not referenced anywhere<\/td><td>Delete it<\/td><\/tr><tr><td>Page used by one admin yearly<\/td><td>Replace with a report<\/td><\/tr><tr><td>Page used daily by many<\/td><td>Migrate properly<\/td><\/tr><tr><td>Page renders a PDF<\/td><td>Keep it as Visualforce<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Split the Logic Out<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This is the step that saves the most time. Move the data work into a service class that both the old page and the new component can call.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public with sharing class CourseService {\n    public static List&lt;Course__c&gt; search(String keyword) {\n        String like = '%' + String.escapeSingleQuotes(\n            keyword == null ? '' : keyword) + '%';\n        return [SELECT Id, Name, Fee__c FROM Course__c\n                WHERE Name LIKE :like ORDER BY Name LIMIT 200];\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now the old controller just calls it, and nothing has changed for users yet.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Expose It for LWC<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>public with sharing class CourseCtrl {\n    @AuraEnabled(cacheable=true)\n    public static List&lt;Course__c&gt; getRows(String keyword) {\n        return CourseService.search(keyword);\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>cacheable=true<\/code> lets the component use a wire adapter, which caches results in the browser.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Build the Component<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>import { LightningElement, wire } from 'lwc';\nimport getRows from '@salesforce\/apex\/CourseCtrl.getRows';\n\nconst COLUMNS = [\n    { label: 'Course', fieldName: 'Name' },\n    { label: 'Fee', fieldName: 'Fee__c', type: 'currency' }\n];\n\nexport default class CourseList extends LightningElement {\n    keyword = '';\n    columns = COLUMNS;\n\n    @wire(getRows, { keyword: '$keyword' })\n    rows;\n\n    handleChange(event) {\n        this.keyword = event.target.value;\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The dollar sign in <code>'$keyword'<\/code> makes the wire re-run whenever the value changes. That replaces the whole postback cycle.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;template&gt;\n    &lt;lightning-card title=\"Courses\"&gt;\n        &lt;lightning-input label=\"Search\" onchange={handleChange}&gt;&lt;\/lightning-input&gt;\n        &lt;template lwc:if={rows.data}&gt;\n            &lt;lightning-datatable\n                key-field=\"Id\"\n                data={rows.data}\n                columns={columns}\n                hide-checkbox-column&gt;\n            &lt;\/lightning-datatable&gt;\n        &lt;\/template&gt;\n    &lt;\/lightning-card&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Tag Mapping Reference<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This table maps the markup you will replace.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Visualforce<\/th><th>LWC equivalent<\/th><\/tr><\/thead><tbody><tr><td>apex:pageBlock<\/td><td>lightning-card<\/td><\/tr><tr><td>apex:pageBlockTable<\/td><td>lightning-datatable<\/td><\/tr><tr><td>apex:inputField<\/td><td>lightning-input-field<\/td><\/tr><tr><td>apex:outputField<\/td><td>lightning-output-field<\/td><\/tr><tr><td>apex:inputText<\/td><td>lightning-input<\/td><\/tr><tr><td>apex:commandButton<\/td><td>lightning-button<\/td><\/tr><tr><td>apex:repeat<\/td><td>template for:each<\/td><\/tr><tr><td>apex:pageMessages<\/td><td>ShowToastEvent or inline markup<\/td><\/tr><tr><td>apex:form<\/td><td>Not needed, no postback<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Visualforce vs LWC<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This table shows what actually changes.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Feature<\/th><th>Visualforce<\/th><th>LWC<\/th><\/tr><\/thead><tbody><tr><td>Rendering<\/td><td>Server<\/td><td>Browser<\/td><\/tr><tr><td>View state<\/td><td>Yes, 170 KB cap<\/td><td>None<\/td><\/tr><tr><td>Data access<\/td><td>Controller getters<\/td><td>Wire or imperative Apex<\/td><\/tr><tr><td>Reusable<\/td><td>Page level<\/td><td>Component level<\/td><\/tr><tr><td>PDF output<\/td><td>Supported<\/td><td>Not supported<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-diagram-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-diagram-2-1024x640.png\" alt=\"Migrating Visualforce to LWC comparison of the two frameworks\" class=\"wp-image-2415\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-diagram-2-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-diagram-2-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-diagram-2-768x480.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Visualforce compared with LWC.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In short, almost everything moves across except PDF generation. Keep those pages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Running Both Side by Side<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You do not have to switch in one release. Lightning Out lets you drop an LWC into an existing Visualforce page, so you migrate a section at a time.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;apex:page&gt;\n    &lt;apex:includeLightning \/&gt;\n    &lt;div id=\"container\"&gt;&lt;\/div&gt;\n    &lt;script&gt;\n        $Lightning.use(\"c:courseApp\", function() {\n            $Lightning.createComponent(\"c:courseList\", {},\n                \"container\", function(cmp) { });\n        });\n    &lt;\/script&gt;\n&lt;\/apex:page&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This needs a small Aura application that declares your component as a dependency. It is a useful bridge for a large page you cannot rewrite in one go.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common Mistakes when Migrating Visualforce to LWC<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Rewriting the markup first and leaving the Apex tangled in the controller.<\/li>\n\n<li>Migrating pages nobody uses, instead of deleting them.<\/li>\n\n<li>Forgetting @AuraEnabled on wrapper fields, so data arrives empty.<\/li>\n\n<li>Trying to move a PDF page, which LWC cannot replace.<\/li>\n\n<li>Switching everyone at once with no fallback.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices when Migrating Visualforce to LWC<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Move logic into a service class before touching any markup.<\/li>\n\n<li>Migrate the most used pages first, since they return the most value.<\/li>\n\n<li>Keep the old page live until the new one is proven.<\/li>\n\n<li>Use lightning base components rather than rebuilding inputs by hand.<\/li>\n\n<li>Delete the old page, button and tab once usage reaches zero.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Practice Task<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Take any Visualforce page in your org with a table. Write the service class and the @AuraEnabled method for it, without building the component yet. Hint: mark the method cacheable when it only reads data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Most Asked Migrating Visualforce to LWC Interview Questions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">These Migrating Visualforce to LWC questions come up in modernisation projects.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Basic Migrating Visualforce to LWC Interview Questions<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q1: Why migrate from Visualforce to LWC?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Migrating Visualforce to LWC gives faster pages, no view state limit and access to new platform features that only support components.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q2: What replaces a Visualforce controller?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When Migrating Visualforce to LWC, static Apex methods marked @AuraEnabled replace it, called from the component.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q3: What replaces apex:pageBlockTable?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The lightning-datatable base component replaces it, with columns defined in JavaScript.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q4: Does LWC have view state?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">No. State lives in JavaScript in the browser, so Migrating Visualforce to LWC removes the 170 KB limit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q5: Can LWC generate a PDF?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">No. Keep a Visualforce page for that, or call an external service.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q6: What does cacheable true mean?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Apex method only reads data, so results can be cached and used with a wire adapter.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q7: What is Lightning Out?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A way to run a Lightning component inside a Visualforce page or an external site.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q8: Which should new development use?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">LWC, because Salesforce builds all new capability there. So every new screen should start as a component.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Intermediate Migrating Visualforce to LWC Interview Questions<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q9: What is the first step in a migration?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Inventory the pages and find which are actually used, since many can simply be deleted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q10: Why move logic to a service class first?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because both the old page and the new component can then call the same code, so the switch is low risk.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q11: What replaces a postback?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A wire adapter that re-runs when its parameters change, or an imperative Apex call.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q12: How do you show messages in LWC?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Fire a ShowToastEvent, or render the message in the template.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q13: What happens to a wrapper class in the move?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Each field needs @AuraEnabled, otherwise it does not reach JavaScript.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q14: Can both versions run at once?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Keep the Visualforce button and add the component elsewhere until users have moved.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q15: How do you handle a multi-step wizard?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hold the state in the component and call Apex only at the end, which removes the view state problem entirely.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q16: What about JavaScript already on the page?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Rewrite it inside the component. Direct DOM manipulation across components is not allowed in LWC.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Advanced Migrating Visualforce to LWC Interview Questions<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q17: Scenario: a page has 4,000 lines of markup and logic. How do you approach it?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Break it into sections, migrate one section at a time with Lightning Out, and keep the old page as the container until the last piece moves.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q18: How do you prove the new page is correct?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run both against the same records and compare outputs, then pilot with a small group before the full switch.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q19: What performance gains should you expect?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Less data over the network and no view state, so pages load faster. However, badly written Apex is still slow in either framework.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q20: Scenario: users report the component is slower than the old page. What do you check?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Too many wire calls, uncached Apex, large datatables without paging and work done in renderedCallback.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q21: How do you handle sharing differences?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Standard controllers enforced user access automatically. So your Apex methods now need with sharing and explicit field checks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q22: When is it right not to migrate?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PDF pages, rarely used internal tools and anything scheduled for retirement. Spending effort there wins nothing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q23: How do you measure progress?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Track page views on the old pages each month and aim for zero before deleting them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q24: What governance helps a long migration?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A rule that no new Visualforce is written, plus a list of pages with an owner and a target date for each.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q25: How long does Migrating Visualforce to LWC usually take?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It depends on page count and complexity, not on a fixed figure. However, splitting logic out first makes each later page much faster to move.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q26: Does Migrating Visualforce to LWC break existing buttons?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Only if you remove the page. So keep the button pointing at the old page until the component is proven, then switch it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q27: Can a component be added to a record page without code?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Once it is exposed in its meta XML, admins drag it onto the page in Lightning App Builder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q28: What is the biggest hidden cost in Migrating Visualforce to LWC?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Retesting business rules that lived quietly in the old controller. Therefore write tests on the service class before you move anything.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q29: Should you migrate email templates built in Visualforce?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Not usually, since Lightning email templates cover most cases. For complex merges, keep the Visualforce template.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Official Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/lwc\/guide\/\" target=\"_blank\" rel=\"noopener noreferrer\">Lightning Web Components Developer Guide<\/a><\/li>\n\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.pages.meta\/pages\/pages_lightning_out.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Visualforce Guide: Lightning Out<\/a><\/li>\n\n<li><a href=\"https:\/\/trailhead.salesforce.com\/content\/learn\/modules\/lightning-web-components-basics\" target=\"_blank\" rel=\"noopener noreferrer\">Trailhead: Lightning Web Components Basics<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Quick Recap<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Migrating Visualforce to LWC removes view state and speeds up pages.<\/li>\n\n<li>Move Apex into a service class before changing any markup.<\/li>\n\n<li>Expose data through @AuraEnabled methods, cacheable for reads.<\/li>\n\n<li>Lightning Out lets both run side by side during the change.<\/li>\n\n<li>Keep Visualforce for PDF generation, which LWC cannot do.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s Next?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Next, we start the LWC block with <a href=\"https:\/\/swapnilzambare.com\/blog\/lightning-base-components-overview\/\">Lightning Base Components<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Migrating Visualforce to LWC is work most Salesforce teams face, because Salesforce builds new features only for Lightning Web Components. The risk is doing&hellip;<\/p>\n","protected":false},"author":1,"featured_media":2413,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_swapz_level":"","_swapz_series_part":0,"_swapz_hide_toc":false,"_swapz_hide_featured":false,"_swapz_description":"","footnotes":""},"categories":[245,8,96],"tags":[68,254,113],"swapz_series":[],"class_list":["post-2416","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-lightning-web-components","category-salesforce","category-salesforce-developer","tag-advanced","tag-aura-and-visualforce","tag-lwc"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Migrating Visualforce to LWC Step by Step<\/title>\n<meta name=\"description\" content=\"Learn Migrating Visualforce to LWC with a tag mapping table, controller changes, Lightning Out, a phased plan and the most asked interview questions.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Migrating Visualforce to LWC Step by Step\" \/>\n<meta property=\"og:description\" content=\"Learn Migrating Visualforce to LWC with a tag mapping table, controller changes, Lightning Out, a phased plan and the most asked interview questions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/\" \/>\n<meta property=\"og:site_name\" content=\"Swapnil Zambare - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-22T07:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-15T05:59:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-featured.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Swapnil Zambare\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Swapnil Zambare\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/migrating-visualforce-to-lwc\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/migrating-visualforce-to-lwc\\\/\"},\"author\":{\"name\":\"Swapnil Zambare\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/10b09224c8bcc562716e86789427592a\"},\"headline\":\"Migrating Visualforce to LWC: A Practical Step by Step Plan\",\"datePublished\":\"2026-10-22T07:30:00+00:00\",\"dateModified\":\"2026-11-15T05:59:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/migrating-visualforce-to-lwc\\\/\"},\"wordCount\":1556,\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/migrating-visualforce-to-lwc\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/migrating-visualforce-to-lwc-featured.png\",\"keywords\":[\"Advanced\",\"Aura and Visualforce\",\"LWC\"],\"articleSection\":[\"Lightning Web Components\",\"Salesforce\",\"Salesforce Developer\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/migrating-visualforce-to-lwc\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/migrating-visualforce-to-lwc\\\/\",\"name\":\"Migrating Visualforce to LWC Step by Step\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/migrating-visualforce-to-lwc\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/migrating-visualforce-to-lwc\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/migrating-visualforce-to-lwc-featured.png\",\"datePublished\":\"2026-10-22T07:30:00+00:00\",\"dateModified\":\"2026-11-15T05:59:53+00:00\",\"description\":\"Learn Migrating Visualforce to LWC with a tag mapping table, controller changes, Lightning Out, a phased plan and the most asked interview questions.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/migrating-visualforce-to-lwc\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/migrating-visualforce-to-lwc\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/migrating-visualforce-to-lwc\\\/#primaryimage\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/migrating-visualforce-to-lwc-featured.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/migrating-visualforce-to-lwc-featured.png\",\"width\":2400,\"height\":1260,\"caption\":\"Migrating Visualforce to LWC featured image: code editor card with LWC import\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/migrating-visualforce-to-lwc\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Migrating Visualforce to LWC: A Practical Step by Step Plan\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"name\":\"Swapnil Zambare - Blog\",\"description\":\"Salesforce &amp; Tech Guides\",\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\",\"name\":\"Swapnil Zambare - Blog\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"width\":512,\"height\":512,\"caption\":\"Swapnil Zambare - Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/theSwapnilZambare\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/10b09224c8bcc562716e86789427592a\",\"name\":\"Swapnil Zambare\",\"sameAs\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\"],\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/author\\\/swapnil-zambare\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Migrating Visualforce to LWC Step by Step","description":"Learn Migrating Visualforce to LWC with a tag mapping table, controller changes, Lightning Out, a phased plan and the most asked interview questions.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/","og_locale":"en_US","og_type":"article","og_title":"Migrating Visualforce to LWC Step by Step","og_description":"Learn Migrating Visualforce to LWC with a tag mapping table, controller changes, Lightning Out, a phased plan and the most asked interview questions.","og_url":"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/","og_site_name":"Swapnil Zambare - Blog","article_published_time":"2026-10-22T07:30:00+00:00","article_modified_time":"2026-11-15T05:59:53+00:00","og_image":[{"width":2400,"height":1260,"url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-featured.png","type":"image\/png"}],"author":"Swapnil Zambare","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Swapnil Zambare","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/#article","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/"},"author":{"name":"Swapnil Zambare","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/10b09224c8bcc562716e86789427592a"},"headline":"Migrating Visualforce to LWC: A Practical Step by Step Plan","datePublished":"2026-10-22T07:30:00+00:00","dateModified":"2026-11-15T05:59:53+00:00","mainEntityOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/"},"wordCount":1556,"publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-featured.png","keywords":["Advanced","Aura and Visualforce","LWC"],"articleSection":["Lightning Web Components","Salesforce","Salesforce Developer"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/","url":"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/","name":"Migrating Visualforce to LWC Step by Step","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/#primaryimage"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-featured.png","datePublished":"2026-10-22T07:30:00+00:00","dateModified":"2026-11-15T05:59:53+00:00","description":"Learn Migrating Visualforce to LWC with a tag mapping table, controller changes, Lightning Out, a phased plan and the most asked interview questions.","breadcrumb":{"@id":"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/#primaryimage","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-featured.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/migrating-visualforce-to-lwc-featured.png","width":2400,"height":1260,"caption":"Migrating Visualforce to LWC featured image: code editor card with LWC import"},{"@type":"BreadcrumbList","@id":"https:\/\/swapnilzambare.com\/blog\/migrating-visualforce-to-lwc\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/swapnilzambare.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Migrating Visualforce to LWC: A Practical Step by Step Plan"}]},{"@type":"WebSite","@id":"https:\/\/swapnilzambare.com\/blog\/#website","url":"https:\/\/swapnilzambare.com\/blog\/","name":"Swapnil Zambare - Blog","description":"Salesforce &amp; Tech Guides","publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/swapnilzambare.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/swapnilzambare.com\/blog\/#organization","name":"Swapnil Zambare - Blog","url":"https:\/\/swapnilzambare.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","width":512,"height":512,"caption":"Swapnil Zambare - Blog"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/in\/theSwapnilZambare"]},{"@type":"Person","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/10b09224c8bcc562716e86789427592a","name":"Swapnil Zambare","sameAs":["https:\/\/swapnilzambare.com\/blog"],"url":"https:\/\/swapnilzambare.com\/blog\/author\/swapnil-zambare\/"}]}},"_links":{"self":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/2416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/comments?post=2416"}],"version-history":[{"count":1,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/2416\/revisions"}],"predecessor-version":[{"id":3199,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/2416\/revisions\/3199"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media\/2413"}],"wp:attachment":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media?parent=2416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/categories?post=2416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/tags?post=2416"},{"taxonomy":"swapz_series","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/swapz_series?post=2416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}