Scenario: Migrate WordPress Sites from Ubuntu LAMP Server to a new HostFor years I have hosted some family WordPress sites on a Cloud server. Needing to both upgrade it and move it to a new Cloud location, necessitated transferring the websites to a new host and not simply migrating the server. There were multiple factors that led to this approach and I'm sure several ways to solve this problem. However, I have needed to determine a good way to back up WordPress sites and a documented method of migrating test sites to production.What I found that worked for me was the following steps and using the plugin (Duplicator). I have now migrated numerous sites using this method both from on-prem servers and from cloud to cloud.STEPS:Setup new location (LAMP Server)Create a new database and database user (on the new server) that will be used for the website. Does not need to match the old website/database. Data will be imported into the new database. Database Config$ sudo mysql -u rootType 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> CREATE DATABASE newdatabasename;mysql> CREATE USER newdatabaseuser@localhost IDENTIFIED BY '<your-password>';mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER -> ON newdatabasename.* -> TO newdatabaseuser@localhost;I ran into problems with one import and it required that I "GRANT ALL" to the newdatabaseuser for the full import of the website to work.mysql> FLUSH PRIVILEGES;mysql> quit Create a new folder in the new location (/var/www/newsite)Install “Duplicator” Plugin on the current siteRun Duplicator and create a packageOn Some older Mysql installations, I had to change the following settingDuplicator -> Settings -> Packages -> SQL Mode -> Change from Mysqldump to PHPcodeDownload both the .zip and installer.php files to my local machineSCP -> New Server/LocationYou can use whatever method you want to move the files from the server to the new host/server.Copy both files to the new directory on the new serverUnzip .zip file or when you run the the Installer.php file, it will ask for the .zip file and unzip it as part of the installation process.Change ownership & permissions on the new location (before running the installer.php)chown -R www-data:www-data /var/www/newsitelocationchmod -R 755 /var/www/newsitelocationRun Installer (installer.php)https://newsitelocation/installer.phpProvide database name, user, and password.Validate info (step in installer)ImportLogin to the new site to validate
"WordPress - How to Migrate Site to new Server"
No comments yet. -