Designer turned Dev figuring out my WP workflow with Local

Okay so first I have to say I’m pretty new to development. I am decently handy with HTML, CSS, and JS, but I know very little about the fundamentals of backend, and I basically just know how to make my own theme in WP by using ACF, CP UI, and a little bit of PHP loops/queries etc.

Local has made the process of handling my local development much easier, but having got my first WP portfolio website live, I’m having trouble wrapping my head around the workflow I should use to keep deploying changes to my code and database simple.

I currently have a program called GoodSync that allows me to sync a local folder on my computer with the FTP. It’s kind of like setting up a dropbox except it’s p2p. I add a file to my local folder and it will automatically upload to the website.

I’ve only set it up to sync the wp-contents folder. The config files should remain separate between the local and live website.

I’m wondering if anyone had a suggestion for some kind of automated system for deploying the database updates to the live website?

Is there a preferably free plugin that handles this well?

I’ve also heard a lot about using git for deploying changes to code to the live or staging website. This is good for changes to theme code but not to WP-upload correct? Because wp-upload is going to be media files which are binary and therefore don’t upload easily right?

And git deployment doesn’t take care of database stuff so how do people deploy changes to database using this method?

Hi David –

Good job taking the red dev pill – it’s a deep rabbit hole to fall down! :wink:

As a general rule of thumb, once a site has completed it’s initial development and has been pushed live – I try and do content work only on the live site.

This means things like publishing posts, uploading media, etc – should be done on the live site. I like to try and have the live site be the canonical source – the single source of truth.

There’s this odd grey area though for things that are more involved like a complex landing page, or a theme re-design. There might be updates to the theme as well as adding content to the WP admin.

In these situations, I will pull the site down to Local so that I have the most recent version of the site and create those styles and content changes. For a fairly static site (ie, non-ecommerce) site, you can then just push your changes up to the server. For more dynamic sites I’ll just replicate my changes on the Live site (create the page in the WP admin, add the media, upload the theme changes).

It’s great that you are aware of Git – I think it is a great tool and allow you to really start treating your code as something that has a history as well as a great way to share and merge changes.

While people do deploy changes with Git, I find it better to not think of Git as a deploy tool, and rather as a development tool. Once you get the code changes into a more stable state, you can create a commit (a snapshot) of the code and push it up to Github.

Here’s an interesting plugin for WordPress which can watch a github repo and pull in updates to themes or plugins:

I think the most difficult part of WordPress local development is the DB, and because of the way that WordPress stores data, there aren’t any really good ways of merging two DBs (in this case, local and Live).

Of course this is just how I work, and each person learns/works differently. I’d recommend a google search along the lines of ‘wordpress git workflow’ and start getting ideas from other people. Nothing will fit 100%, but you can take bits from everything you find!

Hope that helps!

– Ben

Thanks! I saw the Github Updater thing on another thread and I think I’m
going to try that!

Currently I’m doing okay with Duplicator. Treating my live website as the
Canon for the DB and just doing transfers whenever I need to for developing
stuff locally properly. A lot of the issue I was having was just
understanding the flow for Local’s db login etc. I didn’t realize it was
root root until I had looked around a little bit etc.

Paging @afragen :wink:

Andy is the author of the GitHub Updater plugin and also very active here in the Local community.

Hey @clay I haven’t carried a pager in over a decade :wink:

If you have any questions about GitHub Updater I’m more than happy to answer them. As far as DB syncing there’s a plugin called WP Site Sync that may work for you.

I do all my development and testing of GitHub Updater using Local. Take a look at the wiki, it will help explain usage.

1 Like

Another tool for syncing databases is WP Sync DB.

Actually found that recently too but it hasn’t been updated in 2 years and
I couldn’t get it to work properly. Not sure why. Wish I could since it
would be super useful. Guess I’ve got to pony up for the pro version that
it’s forked from.