Key Questions...

274 views
Skip to first unread message

Tom Whitaker

unread,
Jan 15, 2014, 2:03:13 PM1/15/14
to wordpress-...@googlegroups.com
Hi Everyone,

I'm really new to setting up servers and development environments.  I guess I'm a cowboy coder but I'm trying to evolve.  I have a few questions that I need to answer in regards to setting up my new workflow and I was hoping this group could help me with answers. Forgive me if these questions are really basic.  But first a brief summary of my goal.  

I currently run Wordpress Multisite (subdomains) with about a dozen active sites on a shared host LAMP stack.  I'd like to setup a local development environment based on this existing Wordpress content that uses modern tools like NGINX and memcached and then replicate that environment on a live VPS from Digital Ocean. Here are my questions:

  1. What is the best way to replicate my existing Wordpress Multisite install locally?
  2. How will changes made in the local version be sent to the live web server?
  3. How will changes made in the live version be synced with the local version?
  4. Will the local development solution require an internet connection to operate?


One final question would be, does this type of setup even exist?  

Thanks for your attention.  I hope you can help me.

Tom 

Robert Lilly

unread,
Jan 17, 2014, 12:06:04 PM1/17/14
to wordpress-...@googlegroups.com
I don't have the answers to your questions, but I too would like to know. I am especially interested in how to turn a VVV machine into an image for a VPS. In the image I don't want all the development stuff (wordpress-default, wordpress-develop, wordpress-trunk, etc.) only my site.

Jeremy? 10Up guys? Any help would be appreciated.

Robert

Weston Ruter

unread,
Jan 17, 2014, 12:11:16 PM1/17/14
to Robert Lilly, wordpress-...@googlegroups.com
I think that VVV is not intended to be used for a production environment. It has tools and configurations specifically for development. At our last PDXWP meetup, Joe Hoyle was saying that their Vagrant setup (Salty WordPress) is however intended, if I recall properlty, to be used both as a local development environment and to be pushed up to a production server for use their as well. 


--
You received this message because you are subscribed to the Google Groups "WordPress and Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wordpress-and-va...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Weston Ruter (Thunderboy)
Head of WordPress Development
X-Team
Skype: x-team_thunderboy | @westonruter | PGP key

Robert Lilly

unread,
Jan 17, 2014, 12:31:55 PM1/17/14
to Weston Ruter, wordpress-...@googlegroups.com
Thanks Weston! I remember that now. I think I can still use VVV, just modify the initial provisioning to create only the environment I want. Since I'm already familiar with VVV (and shell provisioning) that might be faster for me than learning Salty WordPress and Salt. The question about using the VM as a VPS image is more about Vagrant itself instead of VVV. I just signed up with DigitalOcean and discovered they have tutorials on using Vagrant with their service.

I'm still interested in learning answers to Tom's original questions.

Robert

Jeremy Felt

unread,
Jan 19, 2014, 3:52:06 PM1/19/14
to Tom Whitaker, wordpress-...@googlegroups.com
Hey Tom,

Thanks for this set of questions. I think they're common to have and there are a variety of answers for each.

My thoughts–well, opinions.. :)

1. The best way to replicate the WordPress Multisite codebase is likely through version control. Changes made locally in your development environment are pushed to the code base in a repository. This repository is deployed to production through some set of actions. It's also entirely possible to provide workflows that allow for the codebase to updated in production through plugin updates, WordPress updates, etc. The bidirectional flow should still result in a common codebase being preserved in version control so that you can see the changes and deploy quickly.

The database is a different story. If you want to replicate, the best way is probably via mysqldump on the server. A service like http://wpremote.com may also be an answer for various things.

2. My current method for pushing changes from local to live is by using a set of Fabric scripts. https://github.com/jeremyfelt/jeremyfelt.com/blob/master/fabfile.py

There are many different ways to handle that transfer. Ideally, it's something that can be scripted to just happen when you want it to.

3. I use the same method to pull changes from live to local so that I can check them into version control. In some configurations, this may not be desirable. For the work I'm doing at WSU, we aren't planning on having live -> local codebase changes. Things should be tested in development before being pushed to production.

4. Your local connection doesn't necessarily require an internet connection. Only if you rely on outside functionality such as the cloud services provided through Jetpack or externally hosted scripts.

As Weston mentioned, VVV isn't necessarily meant as a mirror with production. There are many aspects that are definitely oriented around WordPress core and plugin/theme development. It is a good stepping stone to a setup where a mirror with production is possible. If your current production server uses Nginx, PHP, MySQL, and Memcached, then this is close. I think 'as close as possible' is completely valid until you're ready to make it match exactly.

When ready to make the development and production environments match exactly, you'll probably find it best to go with a provisioning tool such as Salt, Puppet, Chef, or Ansible.

My favorite thus far is Salt. You can find examples in Human Made's Salty WordPress (https://github.com/humanmade/Salty-WordPress/) and in WSU's Web Provisioner configuration (https://github.com/washingtonstateuniversity/WSU-Web-Provisioner).

Examples for using Puppet as a provisioner can be found in Automattic's VIP Quickstart (https://github.com/Automattic/vip-quickstart) and Sennza's Chassis (https://github.com/sennza/Chassis).

Plenty more to be said on the topic, for sure.

- Jeremy


--

Tom Whitaker

unread,
Jan 19, 2014, 6:54:18 PM1/19/14
to Jeremy Felt, wordpress-...@googlegroups.com
Hey Jeremy,

First let me say thank you for responding to my post.  I appreciate that you're a busy guy.

I'll be honest, after reading your answers, I'm more confused than ever.  I guess I was thinking that there would be a simple application out there that would let me duplicate an existing Wordpress Multisite installation and make it available locally on my Macbook for tasks such as refining a theme with CSS, adding content, or building a new site on the network.

It sounds like I'll have to cobble together a solution from several components such as a git repo, vagrant, Virtualbox, Salty Wordpress, Puppet.  All of these services I barely understand.  This makes it unlikely that I'll be able to do this myself without some serious learning time, frustration, and trial & error.  

One additional question:

If I was to hire someone to set this up for me, what kind of person should I look for?  How long should take to configure all these things?  How much should it cost me?  Do you know anyone?

Ok that's like four questions...Let me know if you can provide the answers.

TW

Ryan McCue

unread,
Jan 19, 2014, 7:54:06 PM1/19/14
to Tom Whitaker, wordpress-...@googlegroups.com
Tom Whitaker wrote:
> I'll be honest, after reading your answers, I'm more confused than
> ever. I guess I was thinking that there would be a simple application
> out there that would let me duplicate an existing Wordpress Multisite
> installation and make it available locally on my Macbook for tasks
> such as refining a theme with CSS, adding content, or building a new
> site on the network.
>
> It sounds like I'll have to cobble together a solution from several
> components such as a git repo, vagrant, Virtualbox, Salty Wordpress,
> Puppet. All of these services I barely understand. This makes it
> unlikely that I'll be able to do this myself without some serious
> learning time, frustration, and trial & error.

Here's how I do it (using Chassis, which Jeremy mentioned before):
https://github.com/sennza/Chassis

1. Clone Chassis: `git clone --recursive
https://github.com/sennza/Chassis.git myproject`
2. Start it up: `vagrant up`
3. Create a "content" directory that contains all my wp-content for the
live site (themes, plugins, etc)
4. Export data I need from the live site (in the admin, Tools -> Export)
5. Import data I need into my local site
(http://vagrant.local/wp/wp-admin/import.php)

You should now have a fully functional test site locally. (Multisite is
a work in progress, but functional:
https://github.com/sennza/Chassis/pull/24)

What I'd really like to work on is automating steps 4-5 (and maybe step
3). I know how I'd like to do it (implementing the exporter in WP API),
but haven't had the time yet.

In an ideal world, I'd like to be able to do this:

$ wp clone http://example.com/ mylocaldir

But that's a ways off at the moment.

(P.S. I'd love to make it happen, and this list is the best place to
find people to help. Does anyone else think this is a good idea?)

--
Ryan McCue
<http://ryanmccue.info/>

Robert Lilly

unread,
Jan 19, 2014, 10:37:41 PM1/19/14
to Ryan McCue, Tom Whitaker, wordpress-...@googlegroups.com

On Sun, Jan 19, 2014 at 4:54 PM, Ryan McCue <m...@ryanmccue.info> wrote:
Does anyone else think this is a good idea?

+1 !!!

Thanks for sharing this Ryan.

BTW - Do the WP export/import tools make use of the progress you made with your GSoC project?

Robert

Ryan McCue

unread,
Jan 19, 2014, 11:07:13 PM1/19/14
to Robert Lilly, Tom Whitaker, wordpress-...@googlegroups.com
Alas, not yet.

Here's what I'd like to do:

1. Implement `/export` in the API
2. Implement `/import/*` in the API
3. Implement `/import/wp` in the WP importer

Then, the various WP CLI commands can be created as a separate project.
I'm still thinking about this at the moment though, there's certainly no
effort started here. It's something I'd love to do, but don't have the
time right now.

That said, if other people are interested, I'd be happy to help
collaborating on such a project.

Tom Whitaker

unread,
Jan 21, 2014, 3:52:25 PM1/21/14
to wordpress-...@googlegroups.com
A quick update for everyone:

As I said, I was looking to create a vagrant-powered local development environment that mirrored my current Wordpress Multisite network.  Here's what I've figured out so far:

- There are precious few public examples of Vagrant boxes with multisite.  Here is the only on Github that I could find: https://github.com/HootSuiteMediaInc/wordpress-multisite-vagrant

- No one has yet combined the goodness of the VVV box (NGINX, Memcached, etc..) with Wordpress Multisite with sub-domains.

- My need appears to be somewhat unique in that I don't typically need to develop new themes or plugins.  My needs are from a site and administration view only.  I just want to tweak existing sites, or add a new one with a premium theme and some customizations.  

My temporary solution:

I think I can accomplish what I want using Desktop Server ProWP Migrate DB, and Github.  

It's not as elegant a solution as I'd like.  What I was hoping to do was to create a vagrant-powered server configuration that uses nginx, memcached, etc...and then push it to a new Digital Ocean droplet when I get back but there doesn't seem to be any way to do this at the moment given my current level of understanding.  Correct me if I'm wrong.  

If anyone has any ideas/comments, I'd love to hear from you.


Tom Whitaker

unread,
Jan 21, 2014, 3:54:32 PM1/21/14
to wordpress-...@googlegroups.com
Sorry just one more thing....I'm not as smart as you guys so please be gentle (simple) in your responses so my slow brain can grasp what you're talking about.

Zachary Brown

unread,
Jan 21, 2014, 6:00:29 PM1/21/14
to Tom Whitaker, wordpress-...@googlegroups.com
From my experience, there's no "easy" way to do this - any way to set this up would be rather complex and very complicated.  The easiest improvement to make in your plan would be to move from Digital Ocean to Amazon and use EC2 - the Amazon Web Services API has been around longer and has many more integration examples than Digital Ocean.  In fact, Vagrant can "deploy" a basic server to AWS using "vagrant up" just the same as it can to a local VM.  It is easy to do once you figure it out, but the learning curve can be a bit steep.  Adding to that, Amazon Web Services is way way way more complicated than Digital Ocean, so it is a whole new ball of string over there.  

There are a few resources on the web for understanding how to provision and setup a server like this from a bare box, which I think is a first good step before figuring out how any of it can be automated.  I refer to rtcamp for Nginx configs to use with WordPress multisite - if you compare the config for subdirectory to the one for subdomains, I think you'll see the difference (https://rtcamp.com/wordpress-nginx-series-updated-wordpress-3-5/).  Evan Solomon wrote a tutorial based on a server he setup back in 2012 which is essentially the configuration that VVV is based on.  It is a good place to start for understanding how to run a good WordPress server:  http://evansolomon.me/notes/faster-wordpress-multisite-nginx-batcache/

Vagrant is a new project and under heavy development.  VVV is even newer and also under heavy development and is evolving daily.  The kind of thing you describe is likely part of everyone's goal, but I don't think anyone has cracked that nut yet.  There's a lot of tools out there that can be cobbled together to get you close, but they take quite a bit of knowledge, some people with beards, and custom scripting and configs to make work - and even then they are very fragile.   From what I've seen, your idea is just ahead of where the technology is at the moment.  

However, looking at the provision.sh file in Vagrant + the web resources I've linked above are a great place to get your feet wet with server administration and setup.  The Evan Solomon guide especially is a great place to understand the basics, then investigate more from there. 

Good luck!

-Zach


Ryan McCue

unread,
Jan 21, 2014, 10:27:28 PM1/21/14
to Tom Whitaker, wordpress-...@googlegroups.com
Tom Whitaker wrote:
> - There are precious few public examples of Vagrant boxes with
> multisite. Here is the only on Github that I could find:
> https://github.com/HootSuiteMediaInc/wordpress-multisite-vagrant

FYI, I merged multisite support into Chassis today. Here's how to use
it: https://github.com/sennza/Chassis#multisite

(In other words, follow the steps I outlined in my previous email, but
set your config before running `vagrant up`)

> It's not as elegant a solution as I'd like. What I was hoping to do
> was to create a vagrant-powered server configuration that uses nginx,
> memcached, etc...and then push it to a new Digital Ocean droplet when
> I get back but there doesn't seem to be any way to do this at the
> moment given my current level of understanding. Correct me if I'm
> wrong.

Check out vagrant-digitalocean:
https://www.digitalocean.com/community/articles/how-to-use-digitalocean-as-your-provider-in-vagrant-on-an-ubuntu-12-10

You should be able to use vagrant to push your site up directly to DO.

(Note: I'm not sure if VVV breaks with the DO provider, but I can't see
anything in Chassis that would.)

Robert Lilly

unread,
Jan 22, 2014, 11:27:39 AM1/22/14
to Ryan McCue, Tom Whitaker, wordpress-...@googlegroups.com
On Tue, Jan 21, 2014 at 7:27 PM, Ryan McCue <m...@ryanmccue.info> wrote:
Tom Whitaker wrote:
> - There are precious few public examples of Vagrant boxes with
> multisite.  Here is the only on Github that I could find:
> https://github.com/HootSuiteMediaInc/wordpress-multisite-vagrant

FYI, I merged multisite support into Chassis today. Here's how to use
it: https://github.com/sennza/Chassis#multisite

(In other words, follow the steps I outlined in my previous email, but
set your config before running `vagrant up`)

Thanks for sharing this Ryan!

> It's not as elegant a solution as I'd like.  What I was hoping to do
> was to create a vagrant-powered server configuration that uses nginx,
> memcached, etc...and then push it to a new Digital Ocean droplet when
> I get back but there doesn't seem to be any way to do this at the
> moment given my current level of understanding.  Correct me if I'm
> wrong.

Check out vagrant-digitalocean:
https://www.digitalocean.com/community/articles/how-to-use-digitalocean-as-your-provider-in-vagrant-on-an-ubuntu-12-10

You should be able to use vagrant to push your site up directly to DO.

(Note: I'm not sure if VVV breaks with the DO provider, but I can't see
anything in Chassis that would.)

I spent the past couple of days experimenting with the digital-ocean plugin and using it as the provider. I can use it to create droplets, rebuild droplets, reload droplets, etc. I used a modified VVV as my starting point. The provisioning for installing packages on the server, apt-get updating, etc. work fine. The one thing I haven't been able to get working at all is synchronizing folders/files from the local hard drive with the droplet. None of the local files are copied to the droplet which really defeats one of the main reasons I want to use Vagrant. I can `vagrant ssh` into the machine and work there directly but none of what I do there exists locally.

So far I haven't even been successful getting rsync to work after the machine is running to sync files that way. There are two articles I'm using to guide me (https://www.digitalocean.com/community/articles/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps, https://www.digitalocean.com/community/articles/how-to-copy-files-with-rsync-over-ssh) but so far, no go.

Has anyone else had any success with this?

Robert

Jeremy Felt

unread,
Jan 22, 2014, 11:52:44 AM1/22/14
to wordpress-...@googlegroups.com, Ryan McCue, Tom Whitaker


On Wednesday, January 22, 2014 8:27:39 AM UTC-8, Robert Lilly wrote:

The one thing I haven't been able to get working at all is synchronizing folders/files from the local hard drive with the droplet.

It appears this will be a lot easier in Vagrant 1.5, when rsync is added as an option for synced_folder. 

Robert Lilly

unread,
Jan 22, 2014, 12:05:05 PM1/22/14
to Jeremy Felt, wordpress-...@googlegroups.com, Ryan McCue, Tom Whitaker
That'll be awesome! Looking forward to it.

Tom Wilkinson

unread,
Aug 27, 2015, 5:01:27 AM8/27/15
to WordPress and Vagrant, t...@tinytoolbox.ca
One thing I always find challenging with all vagrant setups, and thats Chassis, Mercury etc is the local editing of some of the configuration files such as nginx.conf and php.ini and phpmyadmin for sql files to increase the upload limits when importing sites to work on. This is particularly relevant to importing multisites as i end up with xml files of 50mb plus and db files of 200mb.
Reply all
Reply to author
Forward
0 new messages