There are plenty of ways to accomplish the following. Some are more complex and in-turn simple than others. For the non-technical, front-end WordPress developer this is a fool proof way to accomplish moving or relocating WP site install. It doesn’t require a bunch of scripts or scraping or anything like that. It’s the super basic version but it works and it’s pretty simple to follow. Keep in mind, these instructions are for moving or relocating WP site install from one domain/server to a new one. The main use case of these instructions would be that you developed the new WP theme or site on a dev server and when you’re ready to launch, you need to move or relocate the WP site.
So first things first. Back your shit up. You should be doing this regularly but since you’re referring to these instructions it’s highly unlikely you’re using git or something similar to do this for you. So… yes, back it up. Copy your whole install to your local drive of choice. Use phpMyAdmin to “export” your database and save that with the backup of your WP install. Make sure to name these files into a folder that denotes the backup. I generally use an extension like “.bu” or “_bu” – like… “mysite_bu” for accomplishing this. This will take a little bit. Pack a lunch 😉 And you’ll be doing this again so pack a beer with your lunch. Here’s the play-by-play for the whole process… as so eloquently stated by Mr. Mullenweg and his team.
- Download your entire WordPress installation to your hard drive. Name the folder appropriately to indicate that this is your OLD blog’s installation.
- Download your database.
- Go back to your OLD blog and go to options and change the url (both of them) to that of your new site.
- Again, download your entire WordPress installation to your hard drive. Name the folder appropriately to indicate that this is your NEW blog’s installation.
- Download your database once again (but keep the old one). Upload this database to your new server. It will be easiest if you use the same database name and you create a user with the same login credentials on your new server as on your old server.
- If you used a different database name and/or user (see previous step), edit wp-config.php in your NEW blog’s installation folder appropriately.
- Upload the NEW blog’s installation folder to your new site. Presto, your NEW blog should be working!
Pretty basic and kinda bare bones way. As I pre-faced though, this method of moving or relocating WP site install to a new domain is for the non-tech front-end developers looking to launch their dev site to a production domain. If you’re wanting to keep the original version for a development domain, you can do so by following the steps below. I highly recommend you do this, but again, this method is not the most streamlined. Definitely start checking out and using github if you haven’t already. It’ll make this whole process a lot more simple.
- On the original server, delete your OLD blog’s database (remember, you should have a copy on your local computer that you made at the very beginning).
- Upload your OLD blog’s installation folder to your original server, overwriting the files that are currently there (you may also delete the installation folder on the server and simply re-upload the OLD blog’s files).
- Upload your OLD blog’s database from your local computer to the server. That should do it!
Enjoy and feel free to toss some comments if you’re not sure about any of the steps or have a unique scenario.