December 19, 2013
For Episode 9, we discuss our latest projects and various methods of deploying code and databases to and from servers.
Show Notes:
- What we have been working on
- Brad: Replying to feedback on new WPMDB Pro pricing and updates
- Pippin: Bug hunting settings wipeout with update_option()
- Deployment: Which plugins? Any third-party services / apps?
- Deploying Code
- FTP
- with SSH Access:
- git push (“A web-focused Git workflow” by Joe Maller)
- rsync
- git + Dandelion (ruby gem)
- https://deployhq.com
- https://dploy.io
- Deploy Database
- Free WP Migrate DB or paid WP Migrate DB Pro
- Search and Replace PHP script
- Backup and restore plugins:
- BackupBuddy (commercial only)
- BackWPup (free & commercial)
- Duplicator (free only)
- WP Clone (free only)
- WordPress Move (free only)
- To WP.org:
- Deploying Code
This episode was sponsored by Ninja Forms, the easiest and most flexible FREE WordPress Form builder in existence!
Transcript:
BRAD: Welcome to Apply Filters, the podcast all about WordPress development. I’m your host, Brad Touesnard. And joining me, as usual, is my cohost, Pippin Williamson.
PIPPIN: Hey, everyone. Today, before we get started, we want to welcome our sponsors for this episode. Ninja Forms were kind enough to sponsor the episode. Ninja Forms is a WordPress plug-in for creating forms in your site: contact forms, survey forms, newsletter signups, et cetera. It’s a fantastic plug-in with very active development. You can find them at ninjaforms.com or wpninjas.com.
BRAD: Yeah.
PIPPIN: Go ahead.
BRAD: We’re using it on the Apply Filters site.
PIPPIN: We are. It works really, really well. We’re using it for our little newsletter signup in the sidebar.
BRAD: Yeah.
PIPPIN: But it does much more powerful things than that. It can do much more advanced forms, so I highly suggest checking it out. Also, if you’re a developer interested in an OpenSource project, it’s a really good one to contribute to. They’re very active — there’s a lot of active development on their profile.
BRAD: Cool. So it’s a free plug-in, but there are add-ons.
PIPPIN: Right. It’s a free plug-in that has some pay extensions for it.
BRAD: Okay. Cool.
PIPPIN: Yeah. It’s a pretty sweet plug-in. I like it a lot.
BRAD: Right on.
PIPPIN: Should we jump into our first topic about what we’ve been working on recently?
BRAD: Sure.
PIPPIN: Go for it, Brad. Take us away.
BRAD: All right. Yeah, I’ve just been replying to feedback for the 1.3 launch of WP Migrate DB Pro.
PIPPIN: So what was in that launch? Was that your new media files add-on?
BRAD: Yeah, that’s right, media files add-on, and you could filter post types out of migrations now as well.
PIPPIN: So if I wanted to do a migration of only my attachment post type, I can do that?
BRAD: Yep, absolutely.
PIPPIN: That’s pretty cool.
BRAD: Yeah.
PIPPIN: That is cool.
BRAD: Yeah, so it’s the little things that add up.
PIPPIN: I suspect that wasn’t really that little of a thing.
BRAD: It wasn’t too bad actually.
PIPPIN: No?
BRAD: It was mostly UI change, to be honest, so it wasn’t — and we just copied the table filter in UI.
PIPPIN: When you’re doing that as well, so let’s say that I want to get just the post post-type, so I don’t want pages. I don’t want attachments. I just want post.
BRAD: Mm-hmm.
PIPPIN: When you do that, and let’s say that you’re also pulling over the comments database, would it only pull comments related to posts, or if you had another post-type that had comments enabled on it, it would have pulled those too?
BRAD: True. It does now. During our beta phase, we identified that as a bug.
PIPPIN: Okay.
BRAD: But, yeah.
PIPPIN: I wasn’t sure how far you went with it because I think it would have been very easy to just be like, you know what? This only applies to the post table and the post meta table.
BRAD: Yeah. No, that was something we identified and then we were like, you know what? It definitely shouldn’t migrate comments that are attached to those posts.
PIPPIN: Well, that’s cool.
BRAD: Yeah, we exclude those, which I think makes sense.
PIPPIN: Yeah, definitely.
BRAD: Yeah.
PIPPIN: What else? You said that you were replying to some feedback. What kind of feedback were you getting?
BRAD: Well, we changed our pricing.
PIPPIN: Was this related to the — oh, a pricing change.
BRAD: We changed the pricing.
PIPPIN: Feedback on pricing can be terrifying sometimes.
BRAD: Yeah, I was a little nervous about it, but overall we got a lot of support.
PIPPIN: Overall, it came out pretty well?
BRAD: Sorry?
PIPPIN: Did it, overall, come out pretty well?
BRAD: Yeah, yeah.
PIPPIN: Good.
BRAD: I think, yeah, it was mostly positive. There was a little confusion. That was the main source of negativity. A lot of people misunderstood, so I think I just didn’t do a great job of communicating exactly what had changed, so I think that was probably the biggest problem.
PIPPIN: Sure. Well, I think that’s really easy to do, I mean, especially when you’re so close to a product. It can be very easy to be like — to think that the licensing, the terms, et cetera are all very, very clear.
BRAD: Yeah.
PIPPIN: But it turns out, from a customer’s perspective, they’re maybe not quite so clear.
BRAD: Yeah, exactly.
PIPPIN: I’ve definitely seen a lot of questions like that where, the first time I read the question, I just kind of shake my head like why didn’t you realize that. And then I have to kind of step back and think, well, maybe there’s something that I’m missing that isn’t nearly as clear.
BRAD: Yeah, and I think that the other thing is that, you know, we’re so early in the buying of plug-ins, you know.
PIPPIN: Oh, certainly.
BRAD: It’s not like people have been buying plug-ins for, you know, ten years at this point.
PIPPIN: Well, and I think part of being so early in that there’s a lot of different ways that plug-ins are being sold right now, a lot of different terms, licensing, et cetera. And so there’s not a consistent experience for users. So sometimes they’re buying something forever. Sometimes they’re buying it for a year.
BRAD: Absolutely.
PIPPIN: Sometimes they’re really just buying access to support. I mean, some people are really good about being clear on what’s being purchased. Some are not. So that’s definitely true.
BRAD: Yeah.
PIPPIN: A lot of it, it just comes down to education.
BRAD: Yeah, and that’s what —
PIPPIN: Education and presentation of that.
BRAD: And that’s pretty much why I’ve been furiously responding to emails for the last couple days, so that’s kind of what it comes down to.
PIPPIN: That’s cool.
BRAD: Yeah, but what have you been working on?
PIPPIN: Well, right now we’ve been — I have a big push from now until January, over the last couple months to get the next version of Easy Digital Downloads out, which is 1.9. And it’s had a lot of improvements. I think the last three episodes of Apply Filters have all talked about some enhancement or something that I’ve been working on for it. Like last time I’d been working on a graphing class to allow you to build a graphing — to basically provide a piece of data and then have it graphed for you. So that’s now done.
But then I was moving on to doing some general bug fixes, and I ran into a doozy. And it ended up consuming about four hours of my life last night. And so I have this bug where we have a setting, we have our setting screen, and we have a tab screen, so some of the settings are displayed on each screen. All of these settings are stored in just one option in the database as one big array. And it just uses the standard WordPress settings API. There’s nothing special about it. I mean, there’s nothing abnormal. There’s not a lot of custom code in there in terms of house settings are stored or sanitized and things like that.
But anyway, we discovered this bug when another developer was building an extension where, if you pull the options from the database using just, say, like the get option call, and then so you have one big array of options, and then you change one value. So let’s say you change the value of some key or other. And then you pass it back through update option, which is a very standard practice, it actually wipes out all of the settings for the plug-in. And so instead of just updating that one value, every single value gets — it’s just gone. It obliterates them. And I have not, for the life of me, been able to figure it out yet. And it’s really, really interesting.
BRAD: So every option in the options table just gets set to empty screen. Is that what you mean?
PIPPIN: Oh, no, no, no, sorry, so only our one option. So we have one option called EDD settings.
BRAD: Yeah.
PIPPIN: Which is an array of values.
BRAD: Yeah.
PIPPIN: A value pair. And when you run EDD settings through update option, after you’ve changed that one value, it just gives it a blank array, basically, instead of giving it its normal array of values. So it doesn’t actually save it. So at some point during the save process, it’s interpreting; it’s perceiving the data to be incorrect and just giving it a blank array instead.
BRAD: Ah. Did you end up fixing it?
PIPPIN: And so then all of EDD settings option is just gone. No, I haven’t fixed it.
BRAD: Oh, okay.
PIPPIN: It turned into a rabbit hole, and I haven’t found my way out.
BRAD: And I’m guessing you already dug into the serialization stuff to see if it actually serialized properly, because that would be my first guess is the serialization.
PIPPIN: I haven’t looked at the serialization. That’s a good idea. What I was looking at was the sanitization callback. So when you use the register setting function, it has the third parameter is a callback function to sanitize the data before it’s saved. And so we had a large callback function that we had there that was looping through some data and doing some stuff with it, applying some of our own filters as well. And so I thought that was messing it up because we actually did have one place in that function where, if a value wasn’t there, it would turn it into just an empty array. But it turns out that even if I disable that, it still fails.
BRAD: Hmm.
PIPPIN: Which was strange, and so at that point it’s like straight up WordPress Core.
BRAD: Yeah.
PIPPIN: There’s very little else in there. We have basically register setting on admin in it, and that’s it.
BRAD: Yeah. I’ve never really run into an issue with serialize because the PHP serialization function is very robust. It can handle pretty much anything you throw into it.
PIPPIN: Mm-hmm.
BRAD: But this case almost sounds like it’s spitting out an empty array.
PIPPIN: It does kind of sound like one value wasn’t correctly serialized, so it says, oh, this is no longer valid. We’re going to return false.
BRAD: Yeah.
PIPPIN: Or whatever serialize does when it’s invalid data.
BRAD: Yeah. Well, good luck, man.
PIPPIN: That is what it seems like, so anyway. So that’s my rabbit hole. That’s what I’m working on. I wish I was working on things that were much more interesting, but unfortunately.
BRAD: Sometimes you’ve just got to go down the rabbit hole.
PIPPIN: Yeah, well, I usually — almost every single release, whether it’s for EDD or some other plug-in, I end up having like two or three bugs that sit there for a month or two because I just don’t want to attack them. Unfortunately, we’re like three weeks from the deadline for the release, so I have to.
BRAD: Yeah.
PIPPIN: So anyway, shall we jump onto our next topic?
BRAD: Sure. This is actually a listener question, and I can actually pronounce this because I can speak French.
PIPPIN: Oh, nice.
BRAD: His name is Luke Pransurn. I’m hoping it’s French because, if not, I really butchered that. And he asks what do you guys use to deploy WordPress websites. And this is a topic that comes up a lot, I think.
PIPPIN: Yeah, so we talk all about deployment.
BRAD: Yeah.
PIPPIN: Fun stuff.
BRAD: So we kind of broke this down into a couple different sections, so we’ll talk first about deploying the code, and then talk about deploying the database, and then go into some other stuff.
PIPPIN: And I think we’ll have to be pretty brief on most of these, so we probably won’t get too in depth with them. It’ll be a lot of just kind of mentioning here’s a quick overview of what they do, simply due to time constraints. And there’s a lot of different ones here.
BRAD: Yeah, for sure.
PIPPIN: So if any is interested in going more in depth with any of these, feel free to email us, post a comment to show notes, et cetera.
BRAD: Yeah. And we’ll link everything up that we’re talking about here in the show notes with, you know, a little bit extra information and stuff.
PIPPIN: So what’s the first one for deploying code?
BRAD: Good old FTP.
PIPPIN: You know what? It still works.
BRAD: It does. And it’s the most reliable, I would say, in terms of availability, right?
PIPPIN: Right, in terms of availability.
BRAD: Like it’s almost always available. Right?
PIPPIN: Yeah. If you don’t have FTP on your host then get a new host.
BRAD: Yeah. Yeah, yeah, there’s something wrong. Although, you know what? A lot of hosts, like managed hosts, don’t provide that. I don’t think WP Engine provided it in the very beginning, did they?
PIPPIN: I don’t know, you know, at the beginning. They do now.
BRAD: Yeah. Yeah, FTP is like, it’s got to, you’ve got to have it.
PIPPIN: Yeah. But overall, it’s really not great for deployment for some big reasons. For small sites it works really great. Larger sites, it should probably try to be avoided.
BRAD: Yeah, and the tools matter in this case. If you don’t have any other option but to use FTP, you’re going to probably want to, you know, get a good tool.
PIPPIN: Certainly.
BRAD: I’ve used Transmit in the past.
PIPPIN: Transmit is really good.
BRAD: Only available for Mac though, so if you’re on Windows, you’ll have to find something else. But Transmit has a synch feature that actually compares the timestamps on files, so it doesn’t have to upload everything again, right. It’ll just upload —
PIPPIN: Oh, that’s nice.
BRAD: — your changes.
PIPPIN: Yeah. That’s really nice.
BRAD: So I’ve used that in the past. And then another thing that you can do is you can use this little ruby gem called Dandelion in conjunction —
PIPPIN: What is that?
BRAD: — in conjunction with —
PIPPIN: I’ve heard of it, but I’m not familiar with it.
BRAD: Yeah. It’s a little ruby gem, so a command line tool that works in conjunction with Git, so you set your FTP credentials in a little config file, and then you just do Dandelion deploy, and it will upload the difference based on your Git.
PIPPIN: So you’re working in it. You’re basically working in your Git repository.
BRAD: Yeah.
PIPPIN: And you have all your different commits. And then Dandelion will deploy those changes via FTP to the server.
BRAD: Yeah. It will actually do a Git. It’ll use Git to determine which files have changed.
PIPPIN: Does that assume that the Git repository is on the server as well, or are you just deploying to a directory on the server?
BRAD: You’re just deploying to a — so it does the Git compare locally on your local machine.
PIPPIN: That’s pretty cool.
BRAD: Yeah. I actually discovered it just as I was finishing up client work, and this had been a big problem for me because, oftentimes with client work, you don’t have SSH access, right?
PIPPIN: You have like HostGator or GoDaddy or —
BRAD: Exactly.
PIPPIN: — a small, standard host that your most common tool is FTP. So that would be great for those developers that are familiar with Git, that use a Git workflow, and would like a deployment system, but are working in environments where it’s not available. That’s cool.
BRAD: Yeah. Yeah, Dandelion is a savior for that.
PIPPIN: Yeah, that’s really awesome. So what about these other two that we have on here: deploy HQ and deploy.IO? Can you talk a little bit about those?
BRAD: Yeah. I mean, I’ll just mention them really. I haven’t used them personally. They’re just services, like so SAS services that you subscribe to, and they do kind of, you know, like you enter your FTP credentials, and you give it your GitHub repository, and it kind of just magically synchs up your site. So these things are, you know, fully supported. They have documentation and support, so you can contact them for support and everything. So I just recommend just go and check out their websites. Everything is very clear there.
PIPPIN: Cool.
BRAD: Yeah. They look like very good services. But like I said, I haven’t tried.
PIPPIN: Awesome.
BRAD: One thing we should mention before moving on to databases is what if you do have SSH access to a server, right?
PIPPIN: Oh, certainly. Well, if you have SSH access to the server, and you are a Git developer, there’s a lot of different ways that you can do deployments with Git.
BRAD: Mm-hmm.
PIPPIN: And not requiring any kind of service or anything like that. I’ve done it in a variety of ways. What I’ve actually done recently with some sites, and I’m sure some people will frown at this. Some of this was out of need. Some of it was just because I don’t have that much experience with doing large site deployments. I was actually, instead of pushing to a server, I always pulled down to a server.
BRAD: Okay.
PIPPIN: So I actually would have my repository sitting somewhere.
BRAD: Like Git.
PIPPIN: Like a private GitHub repository or bit bucket or something like that. So then I would push to that, and then I could actually pull from that into my staging server or into my live server.
BRAD: Yeah. I don’t see any problem with that.
PIPPIN: And that’s actually the model that I — that’s one that I use a lot right now with the site that I work on for CGcookie.com. We have a staging server and a live server. And then we keep everything in different branches, so we have our master branch, and we have a dev branch. And then we’ll do feature branches as well for testing new features.
BRAD: Right.
PIPPIN: And so then we just pull down from those, and that works really well.
BRAD: Yeah. Yeah, that sounds like —
PIPPIN: The advantage to it is that instead of just being able to say Git push, and everything goes live, we have to then log — we have to SSH into the server, go to the repository, and then pull it down. So there’s a little bit of extra steps in there, but it still works really well.
BRAD: Yeah. No, that works pretty good. I have actually set up — I kind of started a while ago to kind of refining this process with an article from Joe Maller called a Web-focused Git workflow.
PIPPIN: I feel like I’ve seen that before, but I’ve never read it.
BRAD: Yeah, it’s pretty much the first hit on Google when you search for Git Web workflow.
PIPPIN: Nice.
BRAD: So he kind of details how you set it up, like your basic Git push system. And I guess the golden rule is to never push to a live repository.
PIPPIN: That makes sense.
BRAD: Never push to a working copy.
PIPPIN: Got it.
BRAD: So just a — I think it’s called a bare repository.
PIPPIN: Mm-hmm.
BRAD: So that’s what you do. You push to this bare repository, and then you use a hook, a Git push hook to then pull from the working copy.
PIPPIN: Interesting. I’ve never — I have not done.
BRAD: Yeah. It’s a little more work to set up, but there are some serious advantages. For example, what I’ve got right now when I do a Git push for DeliciousBrains.com, it actually mirrors the repository to GitHub as well. And then it updates the assets, any assets that need to go to Amazon S3. It actually uploads those.
PIPPIN: Oh, very cool.
BRAD: And then it also updates the files in the Webroot, so it does like all this cool stuff, and in one step, and like deploys everything in one command, you know, so it’s — and it’s fully customizable, right? I could do other things if I wanted to, so yeah, it’s pretty neat.
PIPPIN: Yeah….
BRAD: The other thing that you could do with SSH access is you could just run rsynch, run rsynch command, and that would just copy the changes between, you know, your local and your remote repository.
PIPPIN: I use that a lot for, not so much for deployments, but I use it a lot for copying over from a live server to a staging server.
BRAD: Right.
PIPPIN: So like for CGcookie.com, for example, we have like 30 to 58 gigabytes worth of images. And sometimes we want to replicate everything exactly as is to our staging server. Let’s just say things like FTP don’t work so well for that. Rsynch works beautifully though because it takes about three seconds and you’re done.
BRAD: Yeah. Yeah. I don’t even know how rsynch works, but it’s almost magic.
PIPPIN: I have no idea how the technology works. It’s cool though.
BRAD: Yeah, because —
PIPPIN: Props to the people that created it.
BRAD: Yeah. It’s like it instantly knows what’s changed even though, you know, like you said, there might be four gigs and thousands of files, right? It must build some kind of index and then just update it or something.
PIPPIN: Yeah. It’s really cool though.
BRAD: It still boggles my mind how good it is.
PIPPIN: Yeah. Let’s jump into a little bit on deploying databases as well. Like we mentioned, we’re really just going to touch on some of these topics, so we’re not going to get too in depth with these as well. I think the first thing that we have in deploy database, and I’ll talk about these initially. Brad is pretty familiar with them. If you’re deploying WordPress databases, and so let’s say that you have a local development site that you’ve been working on, and then you have a live one. And you have the files are the same in both places.
The files are the same in both places, and you just want to synch the content. So Brad has written two plug-ins called WP Migrate DB and WP Migrate DB Pro, which there is the free version, WP Migrate DB that’s on WordPress.org, and then there’s the Pro version on DeliciousBrains.com as well. And they’re really slick because they basically allow you to take your database from one site and migrate it to another, and do all of the URL updates and things like that.
BRAD: Yeah.
PIPPIN: And it works really, really well for whether you’re doing deployments or you’re doing just testing, migrations, whatever it is that you’re moving. If you need to move the database, those work really well. And I know everyone has heard us talk about them a couple times based on what you’ve been working on and just past episodes and things like that.
BRAD: Yeah. I mean, I guess the problems these things solve might be important to touch on because, you know, people might be wondering why don’t you just use phpMyAdmin, export the database.
PIPPIN: Right, dump the database, import it in.
BRAD: And then import it on the other side. Well, if you’ve tried that, you know that doesn’t work because, first of all, the two options for a site URL and home URL need to be updated before you can even access the dashboard.
PIPPIN: Right, otherwise you get an error establishing database connection.
BRAD: Yeah.
PIPPIN: Or a similar error.
BRAD: Well, actually you get a redirect, infinite redirect usually.
PIPPIN: Oh, that’s right.
BRAD: Right? Because it’s trying to redirect to the URL that doesn’t exist that it can’t find.
PIPPIN: So those two options are pretty easy to update. But, you know, there’s some bigger problems too, aside from those. Think about if you have — let’s say you’re working locally and you’ve built all of your content out, and you’re ready to migrate this client site up to their live server, and you’ve built all the content, which includes images and internal links and all these things. Well, if you have any links that are the full URLs and not relative links, those all have to be updated as well. So these plug-ins will go search all of your post content, your comment content, all of those places for those URLs and will update them as well.
BRAD: Right. And then some people might be —
PIPPIN: And so that can be huge.
BRAD: Yeah, and some people might be wondering, okay, well, why don’t I just run a find and replace on that export file, right, or just a simple find and replace?
PIPPIN: Sure.
BRAD: But what happens if one of those URLs are contained in, let’s say, a widget?
PIPPIN: Then….
BRAD: Then the serialization breaks, right? And then you lose them.
PIPPIN: Yep. And so these plug-ins will fix the serialization.
BRAD: You lose those widgets if you do that.
PIPPIN: Another option, so for those people that do want to do things a little bit more manually, there is actually a really good script for doing a search and replace that’s written specifically for WordPress databases, and it’s called ‑‑ it’s actually just called search and replace for WordPress databases. But it comes from a website called Interconnected, and we’ll have a link in the show notes. But it’s a standalone PHP script that you drop onto a server, and it allows you to do the same thing where you enter the values, the original values, and then what you want the values to be changed to. And it works exceptionally well. And when looking at database migration options, WP Migrate DB Pro and the free version and this PHP script are pretty much the same thing —
BRAD: Yeah.
PIPPIN: — in different forms and to different levels. But they more or less do the same things.
BRAD: Yeah. Yep. And as far as I know, they’re really the only options. So if any listeners have any other ways that they handle database migrations, you should —
PIPPIN: If anybody has a really awesome plug-in or script for doing things like generating a staging environment with including the update to the URLs, if anybody has used WP Engine and is familiar with the way that that staging creation works, I’d love to hear about it because it’s really cool.
BRAD: Definitely. I’ve heard about Vagrant. Is it?
PIPPIN: Mm-hmm.
BRAD: What is it, V?
PIPPIN: Vagrant is pretty slick.
BRAD: I haven’t checked it out. You have?
PIPPIN: Yeah. I mean, it’s for creating development environments. So basically you can spin up a server on your computer, and it can be any kind of server that you want. It could be a Windows server, a Linux server. And it all runs inside of a virtual machine, but it’s virtual.
BRAD: How is it better than like VMware or something?
PIPPIN: The idea that you can tear down or start up a server any time you want very quickly. You can set up — you can have like predefined options, so a lot of people will have like their default plug-ins. They install certain versions of WordPress, things like that. It’s pretty slick. If you haven’t played with it, I’d suggest doing it. It’s very different than a deployment system though.
BRAD: Yeah.
PIPPIN: It’s for creating development environments.
BRAD: I see.
PIPPIN: Cool. Should we move on and quickly touch up on backup and restore plus-ins?
BRAD: Yeah, so that I guess this is another option to do, like to copy a website from, you know, A to B.
PIPPIN: I would think of these as, so when we talk about deployment, I would think of deployment as primarily like deploying changes. I mean, sure, the first time I might be deploying a full website. But after that, it’s mostly just changes.
BRAD: Mm-hmm.
PIPPIN: For these plug-ins that we’re talking about, like backup and restore, is really the first time or like if you’re moving a full site, things like that. It’s not going to be for making small changes live.
BRAD: Yeah. You wouldn’t want to have to do this several times a week or even a month.
PIPPIN: That’d be very tedious.
BRAD: Yeah.
PIPPIN: So what are some of these deployments?
BRAD: Well, probably the most popular one is BackupBuddy, I would say.
PIPPIN: Yeah, from IThemes.
BRAD: From IThemes, but that’s a commercial only plug-in, so there is actually no free option for that. But check that out.
PIPPIN: It works really well though.
BRAD: Oh, yeah.
PIPPIN: I’ll give them that. It’s pretty awesome.
BRAD: Yeah. BackupBuddy is great. Check it out, ithemes.com. BackWPup is another one. They also have a commercial version, but also a free version on the .org repo.
PIPPIN: I think I used their free version a long time ago, but I honestly do not remember my experience with it.
BRAD: Yeah. I don’t think I’ve used any of these, to be honest.
PIPPIN: I haven’t used the next ones we have.
BRAD: Yeah. Duplicator is one on a free only, actually. There’s no commercial version.
PIPPIN: That one, I don’t know anything about except I monitor the WordPress.org reviews forum, and it gets a lot of reviews.
BRAD: Yeah.
PIPPIN: And most of them are good, so statistics point to it being a good plug-in.
BRAD: Yeah.
PIPPIN: I have not tried it out.
BRAD: Yeah. I’ve also noticed several people that have, you know, become customers of Migrate DB Pro, and they’ve previously been Duplicator users, and they’ve moved to a different style of deployment. So it does sound also, just from that anecdotal evidence —
PIPPIN: Sure.
BRAD: — that it’s popular.
PIPPIN: And we’ve got two others for WP Clone and WordPress Move, both of which are designed for moving a site.
BRAD: Yeah. Both are free only and available on the .org repo, so check them out.
PIPPIN: Yeah.
BRAD: Somebody should do a review of like all of these suckers in one.
PIPPIN: Yeah, a comparison just to see what each can do, what the limitations are.
BRAD: Yeah.
PIPPIN: The other one that I can really speak for much is BackupBuddy, which is really slick because it does your standard backups, but it also goes further. It gives you a file backup, a database backup. It also gives you a restore tool and a migration. So just like how we were talking about with WP Migrate DB Pro and the free version and the search and replace script, BackupBuddy has the support for migrating the database between URLs as well, for doing all the advanced search and replace. And that’s something — that was the first time that I had used BackupBuddy was when I needed to do that.
BRAD: That’s awesome.
PIPPIN: Yeah, it works really well.
BRAD: Yeah. I think it’s pretty much, it’s like the de facto standard for backups, I think.
PIPPIN: Yeah. They’ve done a ton of work in making sure that it works on almost every single environment imaginable.
BRAD: Yeah.
PIPPIN: I have had it fail. But to be fair, it was failing on a site that was enormous.
BRAD: Yeah.
PIPPIN: A site that was so large that I don’t expect anything but like a truly hosted backup solution to be able to manage it.
BRAD: Mm-hmm. I know WP Engine forbids BackupBuddy for some. I don’t know why.
PIPPIN: They forbid it for one reason only, and it’s simply that it duplicates functionality that they offer.
BRAD: Oh.
PIPPIN: So WP Engine has an automated backup system that they run, and a restore system as well. And so they don’t allow BackupBuddy just because it’s not needed.
BRAD: Huh. Interesting.
PIPPIN: Personally, I think it’s a little unnecessary to forbid it because if I want to run duplicated backups, that’s my business is kind of my personal feeling. But I don’t care too much.
BRAD: Or what if you wanted to use it to do a database migration or something, right?
PIPPIN: Sure. That’d be — I think, I mean, they don’t forbid it in that you can’t install it. You will just get an email if you have it installed.
BRAD: Oh, really? Oh. That’s not so bad.
PIPPIN: Well, I think — I don’t know if they have multiple ways of doing it. If you have a forbidden plug-in, for example Broken Link Checker is forbidden.
BRAD: Right.
PIPPIN: And if you have it installed, it will send you an automated email, and then it’ll say like if this is not removed after one week, it’ll be automatically removed.
BRAD: You know you’re —
PIPPIN: But I don’t know if they have like tiers for the different levels of restricted plug-ins, so like I don’t know if there’s plug-ins that are advised against simply because it’s duplicated functionality, and then plug-ins that are actually forbidden. I’m not sure.
BRAD: You know you’re a bad ass if you’re running a forbidden plug-in.
PIPPIN: That’s how I gauge it. I’ll admit I got caught a couple times.
BRAD: Nice. Should we talk a little bit about deployment to the WordPress.org repo?
PIPPIN: Yeah, certainly. So like if you want to deploy a plug-in, so anybody who has written a plug-in for WordPress.org knows that you have to do it through SVN.
BRAD: Boo.
PIPPIN: In general. I mean, because the plug-in repository is all SVN, and so you need to use SVN to get your plug in there.
BRAD: Yeah. It’s really not that bad.
PIPPIN: No, it’s really not. The guide that shows you how to do it on WordPress.org is pretty straightforward. It can seem a little scary if you don’t know what SVN is or if you’re unfamiliar with it. But once you’ve done it a couple times, it’s pretty easy. But there are some cool options if you’re not an SVN user. I mean, if you’re an SVN user, that’s awesome. I mean, you can go to town.
But let’s say that you have your plug-ins in GitHub or in a Git repository or any other Git repository. But you don’t want to maintain two different versions of your plug-in. I can tell you that I have a long list of plug-ins that I have written over the last two, three years. And a lot of them were written before I was familiar with some of these deployment methods, and so I have a GitHub version of the plug-in, and I have an SVN version of the plug-in, and I maintain both of them, which is really, really annoying and obnoxious because I have to keep both of them up to date.
Well, there’s a couple of really cool scripts that allow you to do all of your development in Git and then, when you’re ready to push out a release, it will push to the WordPress.org repository for you. Brad, have you ever used these?
BRAD: Yeah, I use the one from Scribu. I don’t know how to say it.
PIPPIN: Awesome. Yeah. They’re fantastic. I use the one from Brainstorm Media, which is Paul Clark. And basically you just run. It’s a little SH script, a little shell script that you run. And it will create a tag of your release. It will push it to SVN and do everything needed. So you do everything in GitHub and never touch SVN.
BRAD: Yeah.
PIPPIN: Which is awesome.
BRAD: That sounds very similar to the Scribu scripts as well. It’s just one command, like you plug-in dash deploy, and that’s it. You’re done.
PIPPIN: Yeah. I highly recommend it. I don’t ever write a plug-in without them now. So every single plug-in that I do now, I mean, unless for whatever reason they’re not on GitHub, which almost all of them are, we’ll use these just because it makes things so much easier.
I used to actually dred doing plug-in updates sometimes because it was just an extra amount of tedious work saying, okay, my plug-in is in GitHub. I’m going to copy over to my SVN, and I’m going to do all these different things. And it was just extra work. Even though it only took a couple minutes, knowing that it’s extra, unnecessary work made me not want to do it. And now I’m just like, oh, make my changes, commit, deploy, done.
BRAD: Perfect.
PIPPIN: Yeah.
BRAD: Man, all this talk about SVN being like ancient has got me thinking about how old I am because I’ve used CVS before.
PIPPIN: I don’t know what CVS is.
BRAD: Yeah.
PIPPIN: Aside from the pharmacy.
BRAD: It stands for concurrent versioning system, and it was the one, the one that everyone used before SVN, and it was horrible compared to SVN. So if you think SVN is bad, oh, man, you’ve got it good with Git.
PIPPIN: Nice. Yeah, I know I was pretty late to the version control game. I never started using version control until about a year and a half ago, maybe two years ago. It was right about when I was getting serious with plug-in development was when I started to get familiar with Git mostly. I had used SVN. I mean, I’ve used SVN since the very first plug-in I released because I had to. But just because you use it doesn’t necessarily mean that you totally understand or appreciate what you’re doing.
BRAD: Yeah.
PIPPIN: It’s just like, well, this is what I have to do to get my plug-in in there. Okay. That’s fine.
BRAD: I think everyone that has used Git, it’s like, you know, starts out at that stage, right? That’s the great thing about Git. You can actually get into it pretty easily just knowing little bits and pieces. And then that gets you into trouble, and then you learn more.
PIPPIN: I always thought that Git was earlier to learn than SVN. But it’s interesting because I actually heard a lot of people tell me the exact opposite and that I’m crazy for thinking that SVN is so much easier. And I think that comes from really learning and understanding version control with Git first as opposed to SVN first.
BRAD: Yes. Absolutely.
PIPPIN: I was using SVN before I was using Git, but I didn’t really have an appreciation for what I was doing.
BRAD: Right.
PIPPIN: It was, Git is what made me fully understand the idea of versioning. So to me, Git is very simple.
BRAD: The whole branching thing between the two is —
PIPPIN: To me, it was super intuitive.
BRAD: Right, but it’s so different between Git and SVN.
PIPPIN: Right, very different.
BRAD: So that’s, I think that’s the big —
PIPPIN: Right, and I think that’s where people start to say, well, Git is so much harder.
BRAD: Mm-hmm.
PIPPIN: I think it’s only, at least from my experience, it’s only harder if you were previously fluent in something like SVN.
BRAD: Yeah. And as soon as you realize, oh, Git, with Git you can just branch all the things, and —
PIPPIN: Branch it all.
BRAD: And it’s amazing, right.
PIPPIN: It’s awesome.
BRAD: Because in SVN, branches are painful, so you don’t want to be branching that much.
PIPPIN: Right.
BRAD: As soon as people realize that, they’re like, oh, my God. What was I thinking? SVN is junk.
PIPPIN: Well, I know there’s so much more that could be said about deployment. We really only touched on some of these. So again, if you have any questions or comments, feel free to drop them in the show notes, send us a message on Facebook, Twitter, Google+, or any other method you feel like getting in touch with us. We’re around. Thanks to our sponsors for Ninja Forms. Go check them out, NinjaForms.com.
BRAD: All right. Thanks, everybody.
Great show and info on deployment methods, development environments, backups and using Git for version control. I did not hear you mention DesktopServer from ServerPress. I am new to creating things on WordPress but have used it several times for creating small websites, deploying them and also importing a zip archive site into a local environment.
It’s worked great for me, just wanted to share:
https://serverpress.com/products/desktopserver/
Thanks,
Daniel
Thanks for the link and feedback!
FYI – git + Dandelion (ruby gem) does not support Windows only OS X and Linux.
Thanks for pointing that out.
Pippin, you’re a great guy and I love your code, but you really need to stop interrupting Brad every two seconds. It’s really annoying.
All episodes are casual conversations. Neither I or Brad intentionally interrupt each other, but I will take your comment to heart and ensure I’m not unconsciously jumping in when I shouldn’t.
The quick & dirty method I used for a long time with the phpMyAdmin migration was downloading the .sql and doing a text replace with Notepad++ (or https://www.scintilla.org/SciTE.html for large files). On occasion, we still do it this way… but it’s a pain when the database gets large as uploading a 100Mb+ .sql doesn’t usually go well via http.
WP DB Migrate Pro ftw!