Hot answers tagged

92

@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 ...


28

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


20

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 ...


19

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 ...


10

The reality is that what we want is this: http://www.liquibase.org/ Liquibase is an open source (Apache 2.0 Licensed), database-independent library for tracking, managing and applying database changes. It is built on a simple premise: All database changes are stored in a human readable yet trackable form and checked into source control. However ...


8

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.


7

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 ...


6

There may be a better way that I am missing but I am going to give you 2 options: 1.Use XML Export to export your new posts and comments. Then use the WordPress Importer to import the new posts and comments back into the dev database It's best to import into dev then move the database over to production because when you import it will download all the ...


5

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 ...


5

You might take a look at a product from iThemes, called BackUpBuddy. I've only used it twice, each time had a hitch or two, but overall it looks promising.


4

I am personally addressing this issue with my project on Github, called Autopress. I don't have a perfect solution yet, but I'm getting closer, especially with the wpstage plugin from the wpengine folks.


4

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 ...


4

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 ...


3

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


3

Whether or not you lock down a staging site really depends on how much you mind the public accidentally seeing a site that's a "work in progress". I'd usually consider it more of a branding decision than a security decision. (This of course wouldn't apply if you're in the middle of developing a secure application that might be buggy, but Wordpress theming - ...


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

While there's no shortage of good solutions here, in the spirit of sharing I thought I would add my bash deploy script to the pile: https://github.com/jplew/SyncDB SyncDB is bash deploy script meant to take the tedium out of synchronizing local and remote versions of a Wordpress site. It allows developers working in a local environment (eg. MAMP) to ...


2

If it's just more of the exact same type of data (some new blog posts, new comments) I'm not sure why you need to sync it really. It's not like it will change the way the code on the site works since it's just more of the same. I typically don't worry about it unless it's a new type of data. I just always make sure I have a good sample of the data for the ...


2

I've been using http://wordpress.org/plugins/wp-clone-by-wp-academy/. It works nicely! Just 3 steps: Install the plugin on both sites. Use the plugin to generate a backup on the old site. Take the backup URL it gives you and plug it into the plugin page on the new site, hit go, and your migration is complete in just a few seconds! It adjusts all the ...


2

Upgrade to latest MU version first. If you run into problems with that, report your feedback and the bugs you encounter to the MU Project. Then Upgrade to WordPress 3.0. If you run into any problems with that step, report it to the WP Project. Update: As far as you're concerned for a quick test (not a mass test), you can do the test locally on a ...


2

Well if you want to do this right, you would have one database for development, one for staging and then the live database. It's just that Wordpress is not designed to live with such commons in software engineering. The component I still see publicly missing is a complete migration script that is able to convert all wordpress settings and data in the ...


2

You might be interested in this Q/A in the FAQ category: Easily Move a WordPress Install from Development to Production? Server mirroring/migration is a pain because there are so many pieces that might (or might not) need to be synced. PHP code (core, plugins, themes) is easy enough to keep straight. But when it comes to data, it gets messier. You've got ...


2

One thought - when I go to www.example.com/staging/wp-admin it automatically redirects me to www.example.com/wp-admin Could the redirect from staging.example.com to example.com/staging be conflicting with the existing install? UPDATE: looks like it could be related to .htaccess issues and complicated domain references in the database From the WP Codex: ...


2

There is really only one way to do an easy transfer of domain or host that I have found. It works flawlessly for me on single and multisite installations. Export your database to a .sql file. ( I use PHPMyAdmin for this ) Create a new copy of the file to be edited with a slightly different name. Open the file in you preferred text editor> ( gedit for ...


2

The Database Sync WordPress plugin does a great job of syncing data between two servers. By default it overwrites ALL destination data, however I've just implemented some enhancements to the plugin which allow you to only sync specific database tables. This can help you retain comments, users and other such data that you don't want overwritten. Does that ...


2

We recently discovered RAMP. Note: this is only a part of the whole process, but syncing content databases between servers is probably the most difficult part of it.


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 config....


2

I would be very hesitant in having the same database for staging and live as any changes to the database would affect both sites (especially when using software like Wordpress where there is configuration in the database). The only time that I would think of pointing to the live database would be if I was doing theme development and was not going to change ...


2

Not an answer but an alternative. I have been using a Ruby Gem called Wordmove for a few months and it's been working great. Still use git for version control but deploy straight from your local environment to either production or staging.



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