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 onExport 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 throughSSH
) 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 theDB_NAME
,DB_USER
,DB_PASSWORD
and 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_HOST
would 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 animport
link. Click on it and upload your DB export file. Note 2: phpMiniAdmin doesn’t supportgzip-compressed
files, so if you did check theCompress file with gzip
option in step2
, 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 steps3
and4
).I guess the only way is to copy the database or part of it.
What I do is to copy the relevant tables and modify manually the site URLs in table options. There are only 2. There is also a nice plugin
velvet-blues-update-urls
to modify all links, after the site URLs are set manually to be able to access the backend, in case posts are also copied.Next, copy all theme directory files to the same directory in the site, assuming you are using the same theme.
Both processes can be automated with a PHP script.
I am not sure this is what you want, but hope this helps.
Not sure that this is exactly what you need, but to move a site you can use the built in WordPress “export” and “import” options. As far as I remember there was an option when importing to change URL’s and the import would change a few things for you.
Even if this does not answer your exact question, hope it helps.