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 pathand optionally check/uncheck the other options). Click onExport Databaseand save the export file to your computer..ziparchive with ALL of your files(the/wp-admin,/wp-content,/wp-includesdirectories and all files in the root directory).unzipcommand throughSSH) File Manager(or any other alternative that you might have) and unzip the file that you just uploaded.wp-config.phpfile and change the values for theDB_NAME,DB_USER,DB_PASSWORDand optionallyDB_HOST– but this is usuallylocalhost– 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 theDB_HOSTwould belocalhost.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 athttp://example.com/, go tohttp://example.com/phpminiadmin.php) and enter your DB details. On top of that page, you will see animportlink. Click on it and upload your DB export file. Note 2: phpMiniAdmin doesn’t supportgzip-compressedfiles, so if you did check theCompress file with gzipoption in step2, you will have to re-do that step with this option unchecked.Settings > Permalinksin order to update your permalink structure./wp-content/uploadsand/wp-content/pluginsdirectories – 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 DBplugin – 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
sshas 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 steps3and4).