Sage workflow (from local to remote server)

Hello guys,
I read the ebook “theme development with-sage” and seen the screencast “theme development with gulp and bower” and I have understand the main feature of Sage Theme.

I am a freelance web designer and usually I must show to my customer the various steps of development… then the best way for me is develop directly on remote server I think…

My workflow is modify Sage in local with MAMP and Sublime Text and with the option “upload_on_save: true” upload the files modified to my VPS (remote server), where I configured WordPress and all the plugins that I use (WPML, ACF, Gravity Forms, etc).
With this method, however, I can not upload automatically the two main file (main.css and main.js) and I must doing manually… I think there is others better methods.

I must work directly on remote server because I do not want to configure two times all (database, plugin, widget, tex content) and upgrade them when modified…

I am confused about a lot of the developer tools… Bedrock, Capistrano, Vagrant, Trellis… :frowning:

I would develop in local and push all files that modify (WordPress settings, plugins, database, theme files like main.css and main.js) to show online the same website that I have in local, is possible?

What is the better workflow for my case?
I know that I am not a senior developer, but someone can help me to work better?


Hi Mateo.

I use a similar set up i.e. running sites locally through MAMP and I use Sublime as a text editor. However, I do not auto upload on save. Most projects would consist of a local server, a staging server (VPS) and a live server (I personally use WP Engine). I use git in my workflow for version control and auto deployment but I’ll skip that for now. My steps in your case would be:

  1. Develop initial build locally
  2. Upload a full copy to the staging server once I’m happy with the initial build
  3. Configure WP Migrate DB Pro or similar on both the local and staging environments
  4. Make any changes I need to make to my local build
  5. Upload whole theme folder from local to VPS once I’m done making changes (minus bower_components and node_modules)
  6. Run the DB syncing plugin/software
  7. Repeat steps 4-6 until client is happy
  8. Push live as per your normal process

Where git fits into my workflow is that I’d run commits when I hit particular milestones. I can then have staging/live environments deployed to automatically via DeployHQ and then sync databases as needed.

I personally wouldn’t want my staging server to reflect every single change I made during the development cycle. I like to only have it updated once I’ve got the development to a point I’m happy with for each round of amends/sprints/improvements etc.

Thank you @nathobson!!
I never used WP Migrate DB Pro, with this plugin is possible to sync the elements (database, post, page) created in local development with remote server?
Also the plugin installed (with their settings) and media files added/uploaded?

Yes, you can either push a database from one site to another, or pull from another site’s database to your current one. It will also handle changing the domain names over during the process. Once it’s set up (which is quick) you can push a database with the click of a button.

If I’m understanding you right, the answer is yes and no. Any database changes will be pushed live such as plugin settings, post/page data, general settings etc. However, the database syncing plugins wont push assets i.e. plugin and upload files. This would be done manually. For example, lets say you’ve just finished a round of amends locally and you’d like to push them up to your staging server (again, this is without git or version controlling):

  1. Upload theme – I’d normally completely override the old theme folder with the new one so I can’t miss any files
  2. Upload and plugin and upload files that might have changed
  3. Run your database syncing plugin of choice

This might seem like a lot of work but realistically, you’ll only be doing this a handful of times.

If you were version controlling, your process might go more like:

  1. Make a commit to your git repository
  2. DeployHQ or similar will deploy that code onto your staging server automatically
  3. Upload any plugin/uploads files to your server
  4. Push your local database to the staging server via plugin

The part where it gets tricky is once you also introduce a live environment where a client might be making changes. But that’s a different story :smile: