Tag Info

Hot answers tagged

75

@Insanity5902: Deployment of a WordPress site from one box to another has been a PITA since day one I started working with WordPress. (Truth-be-told it was a PITA with Drupal for 2 years before I started with WordPress so the problem is certainly not exclusively with WordPress.) It bothered me that every time I needed to move a site I'd have to spend so ...


25

I use git for this and find it works really well. A few suggestions: Add your uploads directory (wp-content/uploads) directory to your .gitignore file. Run a web server and database server on your development system so you can test changes locally before pushing them to production. Keep your database connection settings consistent beween dev and prod, or ...


22

When possible, I set WP_HOME and WP_SITEURL in wp-config.php. This, combined with a database dump and import, is the most simple of all solutions I'm familiar with. http://codex.wordpress.org/Changing_The_Site_URL#Edit_wp-config.php


14

I would highly recommend setting up Capistrano - it's a little bit of upfront work the first time, but after that you can easily use it for new setups. The main advantages are being able to deploy from your desktop. It may not sound like much, but ssh-ing into the your remote server, and doing a git pull is still a pain in the ass. easy rollback to a ...


11

I have a setup I'm pretty proud of, and it works extremely well for my team. General Structure I keep the entire installation under git. All changes, be it a system update, adding/updating a plugin, adding/updating a theme, go through the same workflow. Changes can be rolled back at a moment's notice. I have a deployment server (an old P4 desktop) running ...


9

My favourite hack; add a setting to your /etc/hosts to make the production domain point to your development box, just on your machine. To deploy to production you rsync all the files and push the database over. The risks of this strategy are clear; you might confuse your development environment with your production environment. It still an easy fix ...


6

I wanted something similar when I migrated to WP a few months back, so I wrote a pretty simple shell script that uses rsync and mysqldump over ssh: http://snarfed.org/sync_wordpress It's not sophisticated or web based, but I'm happy with it.


6

WP Engine is a new service that offers "One-Click Staging": WPEngine has an exclusive feature called “staging.” Here’s how it works: Before you make a scary change to your blog, click the “snapshot” button. We make a complete copy of your blog and set it up in a separate, safe area. You can play with anything you want; nothing’s live. Only when you’re ...


5

Externals, definitely. Set up your own SVN repo, then make WP as an external in the repo. I put it into a /wp directory. You can access the WP SVN as an external here: http://core.svn.wordpress.org/ I tend to use trunk. You can use a branch, if you really, really want. Branches get auto updated with minor releases (/branches/3.0 held 3.0, then 3.0.1, 3.0.2, ...


5

I actually did a WordCamp presentation on this topic. Rather than repeat myself, here's a screencast of it and here's a very simple deployment script to accompany what I discussed. In short, I use GitHub to host the repo, and use a webhook to deploy changes based on the git ref. This allows you to use Vincent Driessen's git branching model and opens you up ...


5

I know this question is a little older however as I've not seen this as answer here, I'd like to share what I normally do for single-site git based setups and deployments and it's working really well, also with working from multiple devices, locations and with multiple developers (all having their own local repos they operate in as it is common for git). I ...


5

I'm one of the developers of WP Migrate DB Pro, and would like to answer @Ennui's question: "Do you know if the db url replace script it runs takes into account serialized strings?" Yes, it does handle serialized data. In fact, that is the primary reason I developed the free version of the plugin back in 2009. :) Unfortunately I only have a reputation of ...


5

I would be very afraid to develop on 3.8.1 and try to run the same code on 3.5.1. Things have changed. 3.5.1 is ancient by web app standards. I can't say that I have ever tried to "backport" like that, but it does worry me. Much of your code would work. WordPress itself is pathologically backwards compatible, but if your code uses new features (intentionally ...


4

I have been working on a simple and pluggable command line interface. The basic work is done but we now need to start writing more commands (and implement it in plugins). Please feel free to fork and contribute! You can find the code on Github.


3

Hi @Chris Adams: I just ran across these WordPress Mass Management Tools which are not the same as drush but are the closest thing I seen thus far.


3

This looks promising. We are working on some scripts to handle migrating some of the data, wp-options for example, changing paths in the db, a copying over media. The issue I have is that the live site continues to grow while the other is in development. One site we work on has 20 posts a day and over 3,000 comments per day. That is too much data to ...


3

Two Google Summer of Code projects that have a similar goal: Automatic Migration (GSoC 2010) WordPress Move (proposal) (GSoC 2011)


2

Duplicator Plugin: Here is a plugin that I have been working on. It's currently in beta but it gets the job done for most sites. Right now it is targeted at smaller WordPress installs. http://wordpress.org/extend/plugins/duplicator/ Resources: Additional resources for the plugin can be found here: http://lifeinthegrid.com/duplicator/ Community: Please ...


2

I recommend handling the 301 redirect in your web server rather than in WordPress. mod_rewrite or RedirectMatch will be much more efficient than spinning up WordPress to deliver a Location: header. <VirtualHost *:80> ServerName busted-cheap-url.com # mod_alias RedirectMatch permanent (.*) http://great-new-url.com$1 # OR mod_rewrite ...


2

Normally I login to phpMyadmin upload the database and edit the contents of wp_options>siteurl and wp_options>home to the expected domain. If you need to update URLs within your posts and pages content you can do a search/replace for the URL and the media/uploads path on the .SQL file prior to uploading. It's a quick job.


2

I use subversion's export command to install the WordPress files (http://core.svn.wordpress.org/tags//) as well as all plugins in the repository (http://plugins.svn.wordpress.org//tags//), then just zip the theme and custom plugins and install them normally. Once all of that is up and running without content, I export the test DB and do a search/replace for ...


2

This one will cause you some problems: update wp_options set option_value=replace(option_value,'OLD URL','NEW URL') where option_value like "%OLD URL%"; It will corrupt any active widget data which is stored in the options table, because that information is most likely serialized, and the query doesn't account for serialized data. That was the gist of the ...


2

First, I think its important to consider what you are going to Version Control . I would recommend against putting the entire WP directory under VC. I think it makes the most sense to put wp-content/themes/YourThemeName under VC. For a large site with a high number of complex plugins I could see the case to including wp-content/plugins as well. If you ...


2

I do this with git and mercurial, just make sure you're using a private repo. Option 1. The only problem is the config.php, which you can tell git to ignore on push or before init. Use .gitignore or git update-index --assume-unchanged config.php (read a bit about the assumed-unchanged command before using it) Options 2. Use a conditional in the ...


2

See Codex for running a development copy of wordpress. You can make all the changes you want on the blog without affecting the production site by testing out new themes/etc which is what it seems like you're looking to do. http://codex.wordpress.org/Running_a_Development_Copy_of_WordPress#WordPress_2.7_-_3.0


2

Daniel Bachhuber gave a presentation at WordCamp Seattle 2012 called WordPress at the Command Line – An Introduction to wpshell and wp-cli. The presentation notes are available on his website, and the video should be on WordPress.tv soon.


2

NOTE: XML Importer will not work for this task as the amount of data is too large. This tool is by far the simplest solution if there's any way you can get it to work. Is it absolutely "too large" for the importer, or just limited by file upload / PHP execution time limits? If I were doing this, I'd crank up the limits on my development environment to ...


2

I always check out from wordpress.org's svn repository, and then use svn externals to pull in my own themes/plugins. You don't have to use externals either, you can have your own themes and plugins checked out as their own working copies within the themes and plugins folders of your main WP checkout. One advantage of the externals method is that you can ...


2

Can i, with Git, checkout the most current repo from my live server to my local machine? No, unless you also add the wp-content folder under version control. You can instead look at other tools, such as rsync. As for the database, you could make the live server accept remote MySQL connections, so that you could work on it directly from your dev ...


2

What I do here is I keep an entry in my /etc/hosts file pointing the site domain to 127.0.0.1. Most of the time the line is commented so my machine points to the production site, and when I'm developing something I just uncomment the line and the domain will point to my dev box. I know it's kinda ugly, but since Wordpress puts the domain in a lot of fields ...



Only top voted, non community-wiki answers of a minimum length are eligible