We recently migrated a client’s WordPress site to a new server. We had to change domain names for the WordPress site as a result of the migration. For this site, we built a custom WordPress plugin that used the Visual Composer Website Builder Elements API. However, we ran into issues with Visual Composer after Migration. The following steps helped us fix Visual Composer Issues after Migration.
Step 1: De-Activate Visual Composer, then Re-Activate
Go to your plugins page and deactivate visual composer. Then, reactivate visual composer by clicking on the Activate link. As a result of deactivating and reactivating visual composer, visual composer downloaded all of the assets that we created.
Step 2: Initiate Reset of Visual Composer
Sometimes, it may be necessary as a result of a migration to reset visual composer. This doesn’t delete your content but updates paths after a migration. Hover over Visual Composer in the left sidebar and click on Settings. Then, scroll down to the bottom of the page and click on the Initiate Reset link.
Step 3: Reactivate the Premium Version of Visual Composer
If your theme is using the Premium features of Visual Composer, you may need to re-install the Premium version of Visual Composer. Activating the premium version involves adding your license key and updating the Visual Composer Plugin Accordingly.
Step 4: Replace References to Old Domain Name in your WordPress Database
In addition, you may need to replace all references to your old URL in your WordPress database. The references to an old domain name could be embedded in your Visual Composer templates. This is easy to do with the WordPress Command Line Interface (WP-CLI). You would need to use the search-replace command for WP-CLI, it handles both serialized and non-serialized data in the database. An example of this command is visible below:
wp search-replace 'http://www.old-website.com/' 'http://www.new-website.com/'
If your hosting company doesn’t have WP-CLI, check out our post on installing WP-CLI yourself.
Step 5: Re-Open, Re-Save Global Visual Composer Templates
After we followed the above steps, we had to go into every global Visual Composer template, re-open each template, and re-save each template.
Step 6: Re-Open, Re-Save All Templates that Used a Global Template
Step 7: If You’re Still Having Issues
If you’re still having issues, you may need to hover over Settings and click on Permalinks. Save the permalink settings. If this doesn’t solve your issue, you may need to remove your Visual Composer license key from the old server and transfer it to your new server. Lastly, if you’re still having issues fixing up Visual Composer after a Migration, you may need to open every page of your website using Visual Composer and re-save it too.
And, that did the trick!! You should now have fixed your Visual Composer Issues after Migration!