Migrate virtual server from LAMP server to LEMP server

LAMP SERVER: OS: Ubuntu Linux 18.04.5, Webmin: 1.973, Virtualmin: 6.16
LEMP SERVER: OS: Ubuntu Linux 20.04.2, Webmin: 1.973, Virtualmin: 6.16


I have a WordPress site on a Virtualmin server (LAMP) and would like to move it to another VIrtualmin server (LEMP). I don’t need to move emails and will be setting up new virtual server settings on the LEMP server so the Virtualmin settings don’t have to be moved too.

What would be the right approach to moving the virtual server from the LAMP Virtualmin server to the LEMP virtualmin server?

Differences between then two servers:

  • LAMP to LEMP
  • MySQL 5.7 to MySQL 8
  • Ubuntu 18.04 to Ubuntu 20.04

Everything else (PHP version, Webmin version, Virtualmin version, etc) are the same.

@shillongserver,

I’d conduct a manual migration for this purpose. Keep in mind LEMP approach will require you to come up with an alternative to ModRewrite which allows you to have SEO friendly URLs as ModRewrite is an Apache module not available to Nginx. This doesn’t mean you can’t accomplish what it does, but you might have to do some research on this as WordPress by default comes with Apache optimized settings from what I recall.

The other thing you really need to ask yourself is, “why am I switching to Nginx?” Not that Nginx is bad, but a lot of people seem to be switching to it for the wrong reasons resulting in new challenges they were not anticipating.

Best Regards,
Peter Knowles | TPN Solutions

@tpnsolutions With regards to ModRewrite, I’ll manually edit and add a custom location to the nginx configuration to support permalinks.

And I’m migrating the WordPress site from Apache to Nginx mainly because I noticed that a properly tuned Nginx server handles heavy load better and provides better performance with regards to FPM and caching (even after extensive tuning of Apache server).

@tpnsolutions I will most probably go with the manual approach of exporting the databse and copy pasting the files but just wondering if there is any VIrtualmin approach to this by any chance.

@shillongserver,

Not really, as you’re doing a major infrastructure change. The migration tools used in Virtualmin would setup things the same way they are presently setup, so this won’t work. Best bet, just SFTP the files over to a freshly setup Virtual Server on new machine and export/import SQL file into newly created database.

Make the necessary changes to address the lack of mod_rewrite and a few configuration options in the wp-config.php file (and possibly within the database) and you should be good to go.

Best Regards,
Peter Knowles | TPN Solutions

@tpnsolutions Yeah, I ended up going with the standard db export + copy pasting files approach and everything works as it should now. Cheers!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.