April 4, 2015 - rob
Moving WordPress To New Server
I recently got a new server to host the website. I ran into some trouble getting the database working properly and did not want to install phpmyadmin. After a few searches, I finally found some help. Will post the link below, but the main steps were pretty simple:
Using mysqldump to backup/restore database
This is possible only if your old-server allows SSH access.
We use following command. Values of MYSQL_USER, MYSQL_PASS & DATABASE_NAME are replaces by values from wp-config.php.
mysqldump -u MYSQL_USER -pMYSQL_PASS DATABASE_NAME > DATABASE_NAME.sql
Once DATABASE_NAME.sql gets transfered to new-server, you can use following command to import it:
mysql -u MYSQL_USER -pMYSQL_PASS DATABASE_NAME < DATABASE_NAME.sql
Moving WordPress files
rsync -avz --human-readable --progress firstname.lastname@example.org:/path/to/www-on-old-server /path/to/www-on-new-serverChange your DNS to the new server and wait for that to replicate. Easy as pie. Here is the original post: