Ok, so I'm familiar with creating local Wordpress builds, and have been chugging along happily with the technique outlined in Smashing's MAMP-based article. My question goes a step beyond this.
The article is great for developing generic themes, but when developing sites (not necessarily blogs) based in Wordpress, for me at least, it's a little painful come launch day.
I have to go back in and reconfigure the server's Wordpress to match what I've already done locally. Settings have to be entered again, plugins need be installed again, menus recreated, and css will have to be altered to reference the unique classes/id's Wordpress generates for posts/pages/custom taxonomies…sometimes things are missed in the process. What I want to know is this:
Is there an easy way to automate cloning or mirroring the build on my local machine to the remote server?
Even if you have to just LMGTFY me, that would help. I don't exactly know what I should be searching for. Searches dealing with 'mirroring wordpress configuration' and 'cloning wordpress configuration' returns tutorials on moving content, which I know how to do.
If it helps, I'm running OSX 10.6.8 with xcode dev tools, git, ruby, node, and homebrew. All of my live servers have ssh access as well as ftp, and I build with the most current versions of Wordpress.
Here are some easy steps to follow:
New address (URL)
, New file path
and optionally check/uncheck the other options). Click on Export Database
and save the export file to your computer..zip
archive with ALL of your files(the /wp-admin
, /wp-content
, /wp-includes
directories and all files in the root directory). unzip
command through SSH
) File Manager(or any other alternative that you might have) and unzip the file that you just uploaded. wp-config.php
file and change the values for the DB_NAME
, DB_USER
, DB_PASSWORD
and optionally DB_HOST
- but this is usually localhost
- if that doesn't work try asking your web host, or if you have phpMyAdmin, log-in to it and look at the very top of the page - in this case the DB_HOST
would be localhost
.2
. Note: If your hosting hasn't provided you with a DB administration tool, I would suggest that you upload the phpMiniAdmin(click on the "Download latest version" link and save the file to your computer) script to your production server. Then go to that script(if your website is located at http://example.com/
, go to http://example.com/phpminiadmin.php
) and enter your DB details. On top of that page, you will see an import
link. Click on it and upload your DB export file. Note 2: phpMiniAdmin doesn't support gzip-compressed
files, so if you did check the Compress file with gzip
option in step 2
, you will have to re-do that step with this option unchecked.Settings > Permalinks
in order to update your permalink structure. /wp-content/uploads
and /wp-content/plugins
directories - make sure that you will be able to upload images and plugins without any problems. That's pretty much it. It might seem like a lot, but I follow this process for almost every site that I upload to production servers and it can take me as less as a bit under 10 minutes to do all of that(considering that I usually use custom MySQL commands, instead of the WP Migrate DB
plugin - I should probably start using it :) ). Once you get used to the process and you don't encounter any low-quality web hostings, you should be perfectly fine with these steps.
Note: Since you used ssh
as one of your tags, I assume that you usually have ssh access to the production server. If you don't I'm still assuming that you have a cPanel access(if that's not true and you can't unzip files on the server, then upload all files manually via FTP client, instead of doing steps 3
and 4
).