• Ben Riga

    (@benbuzztoniccom)


    I’m trying to setup a process for a new site I’m building and would like to use source control to manage the site theme, settings and pages/posts. I have not been able to find a how-to on that. Am I missing something? It seems like WP content is spread across files (easy to control) and database (not so much). What do folks use for that sort of thing?

    Thanks,
    Ben

Viewing 2 replies - 1 through 2 (of 2 total)
  • For files, pretty much any of the standard source control systems works well. I normally use SVN, but that’s a habit from years back. Git is pretty popular, but I haven’t used that very much at all before.

    As for databases… that’s a whole other (not very well done) level. At this point I haven’t found anything that will sync MySQL, or any other database type, yet. Some tools claim that they work, but they don’t work that well under most circumstances. With WordPress it’s probably worse because there’s a lot of hard-coded URL’s in the database, so you would also need some sort of migration tool that can change all of these between the various environments when you’re updating as well, which adds yet another layer of compexity that hans’t been figured out yet.

    I use GIT for version control and Mina for deployment. I maintain a local mirror of any site I manage which is pushed to a remote repository. Any updates including theme/plugin installations are dealt with using wp-cli.

    So for instance if I wanted to install the Super Duper plugin I’d go:

    • wp plugin install super-duper
    • Add the files to GIT
    • Commit
    • Push to remote
    • Deploy with Mina

    As for moving databases around, I either use a wp-cli plugin:

    https://github.com/c10b10/wp-cli-deploy

    or:

    https://wordpress.org/plugins/wp-migrate-db/

    I also have a personal license for the pro version of Migrate DB. It works amazingly well.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Best Practices for WordPress source control?’ is closed to new replies.