Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to version control with WordPress

I want to set up a system where a developer can work on a separate server on a wordpress website.

My question is: If in the meantime changes are made to the live site (like plugin updates, new plugins, new posts, new comments, etc), how is one able to import a new feature (e.g. a new page) from the development server on the live site while making sure that previous changes on the live site don't get deleted?

I am looking to understand how this all works. In a sense, I would like to have some kind of version control system.

Thanks in advance :)

like image 394
Stanislaw Lorenz Avatar asked Aug 15 '26 14:08

Stanislaw Lorenz


1 Answers

You can version control your own code using git. Basically we would init a new git repo and commit changes onto this repository. This can lie separately outside of the core files. i.e you only need to include the wp-content directory and ignore all the other core wordpress files. Here is a good article on how to do a really good versioning system for a website.

http://toroid.org/git-website-howto

The posts and pages (basically content) in a wordpress site however lies in the database.Any changes made there will be permanent. The only option is to keep taking regular backups of the content. You can do this by using an automated backup tool. If you really want to version control your database, here is an article that helps:

https://blog.codinghorror.com/get-your-database-under-version-control/

like image 115
Kris Avatar answered Aug 18 '26 03:08

Kris