I’ve been looking for a new way to develop my WP site locally, use Git for for version control and do some form of deployment instead of using FTP. A friend told me about the Bedrock WordPress Stack and I’m excited about the possibilities.
I’m having a hard time finding an answer to one question before I start digging in …
How can I take my existing WP site which is hosted on Hostmonster and move it into Git and use the Bedrock WordPress Stack?
Preface: I don’t know anything about Hostmonster but some shared hosts may just not work with Bedrock. Depends on what kind of access they give you.
I think the best way to move an existing site into Bedrock is to download it into a new separate folder first. Then keep another copy of your project and start moving over files into the correct locations (like moving a theme from
Start with themes and any custom plugins. Any other plugins that aren’t yours, try and move them into
composer.json and let Composer manage them.
Then you’ll need to do some manual work and update the Bedrock configs and merge in any custom settings you had before.
Sounds great, thanks for the response.
Just to be sure I understand the basic flow …
Following your suggestion, I should be able to create a local WP development environment and get a copy of the site running locally with the Bedrock WordPress Stack, correct?
Then I can use my blade server at home as stage environment and test my deploy with Capistrano.
Finally I can deploy to a production environment again using Capistrano.
And a couple of questions …
In case I can’t deploy to Hostmonster, can you recommend a few hosts that support the Bedrock WordPress Stack?
Any tricks or concerns I need to be aware of regarding the migration to Bedrock and the existing Wordpress database used by my site?
FYI … I am a Ruby/Rails developer with very little PHP / Wordpress experience, other than the site I developed for my band (u2act.com). I really need to get away from FTP maintenance trap. It’s driving me nuts.
You can stay with relatively cheap shared hosting and still get Shell access, which is basically what you need for Capistrano. Hostgator has SSH.
Moving up the ladder, you have Media Temple, their “Grid” service which is basically their version of shared hosting, seems to be generally well regarded.
There are many others, but after that, you’re probably looking at a VPS. So you can check out Amazon EC2, Rackspace, or there’s a newer company that looks promising, Codero, our company is checking out currently.
The structure of Bedrock is mostly inspired by Rails conventions so it should feel much more natural to you than a normal WP setup.
That’s correct. Bedrock will soon include a Vagrant setup for easy dev environments, but for now you’re on your own with that. There’s nothing special about Bedrock in this regard, any other WP dev setup will work fine as long as you have PHP >=5.3 and proper virtual host setup (to
Yep, Capistrano can deploy to any environment you define.
Any VPS/dedicated server host would work. Linode and Digital Ocean are probably the easiest/cheapest. Any shared host will probably be a little harder to use Bedrock and deploy with Capistrano in the long run and include workarounds.
As long as you’re keeping the same domain/urls, you shouldn’t need to update anything. You’ll need to define the correct
WP_SITEURL constants which override any existing options in your
Well, time for me to start working on it. I’ll post back here when I get everything functional.
Thanks for your help guys!
I just started using Bedrock a few weeks ago and finally got my deployment working this morning. This is a brand new site so I cannot comment on the shift, but I do not believe it would be too difficult once you understand Bedrock.
I do not use Vagrant yet for local development.
I tried deployment with two different shared hosts.
1&1 - Fail
Absolute nightmare, between differing versions of php in SSH vs fcgi. No CLI executables.
A Small Orange - Pass
Absolute breeze. You do have to request SSH access once your account is set up, but after that it’s quite simple. They even have Composer pre-installed on a system level.
I’ve been living in Ruby for the last year as well (after years in PHP) and forced myself to learn how to do things right this time around. I’m not the greatest at writing up documentation on my own, but maybe I can walk you through the process of a basic setup and we can get a simple tutorial for folks up somewhere.
Thanks Rumpled, I like the tutorial idea!
I’m going to take a couple of days to get familiar with Bedrock, Composer and Vagrant then maybe I can ask you for help on the basic setup since your experience is still fresh in your mind.
Sorry for coming a bit late to the game here, mate, but I’ve got a question for you since it sounds as though we’re in similar boats here.
I’ve recently bought into A Small Orange shared hosting and have oh-so-nearly set up everything in bedrock to deploy my WordPress stack from my development environment to server.
However, it looks like I need to adjust the DocumentRoot of my Virtual Hosts file for my site to load properly. I don’t know if I’m being daft, but is there a very easy way to do this? I tried poking around a bit, but everything I tried to edit was restricted.
As a follow-up, are you still deploying to an A Small Orange shared host, or did you encounter any kind of problems doing so since then?
This is a couple years old, but may still be correct: http://forums.asmallorange.com/topic/16797-best-method-of-changing-the-document-root-of-your-primary-domain/
At the very least, you could change the
web folder of Bedrock, which is the public directory, to
public_html (to mirror A Small Orange), and deploy to the folder about public_html. You would just need to rename
public_html, and then fix it in the configuration files, .gitignore, wp-cli.yaml, application.php I think, and probably the Capistrano config file.
Yeah, I’ve read that already, but as I’m on shared hosting I don’t have write access to the file in question. (I can read it, however. So I know what changes I would like to make).
Okay, so let me see if I’ve got this right. Right now I’m deploying to ~/public_html.
You’re saying to rename
public_html and then deploy to my home (
~) directory, right?
But doesn’t using Capistrano to deploy create a symlink to ‘current’?
For example, deploying with Capistrano right now creates the directory structure
~/public_html/current/web/. Wouldn’t the same problem present itself if
web were simply renamed to
public_html? Or would it work and I’m just misunderstanding?
As a alternative, could setting a
mod_rewrite in an .htaccess file possibly work? Or are we talking about two fundamentally different things?
Ah, yes, Capistrano does. I actually don’t have much experience with the Capistrano portion of Bedrock.
Unfortunately, shared hosting and Capistrano aren’t an awesome match for all the issues you’re running into. Capistrano runs much better when you are on a VPS or dedicated host, as you have more control over your environment.
I did find this in a quick Google by our own @cfx, http://cfxdesign.com/deploy-wordpress-with-capistrano-on-bluehost/ , it looks like you will need to basically allow Cap to install as it wants into public_html, and do some redirects. Good luck!
Thanks a lot for the link!
I worked through his tutorial (about 90% of which applies directly to my A Small Orange shared hosting), and eventually got it working. Woohoo!
There were a few minor changes I introduced, but what really helped out the most was the example
.htaccess file in his final step. It seems to be linking to all the right places without ever having to have changed the Apache vhosts file (which was super helpful as I didn’t have access to it).