How do Bricks users make changes to an existing site that is already in production?
Do you make changes to the live site, perhaps while putting the site in maintenance mode (i.e. late at night)?
Or do you have a development/staging environment and then copy the changes over to the live site? If so, what do you copy? Files, database tables, �
Perhaps Bricks has some tools to make this easier, like export/import?
Many people will give you a litany of backup / migration / etc. plugins to use. After many years using many of them and different methods, none work better and FASTER than using WP-CLI.
With WP-CLI you can from a single terminal (even one terminal on your local machine) connect to 1, 2 or 1000 installs live on servers and locally⦠and do all the updating including plugins you can imagine, without having to visit a single WP dashboard, plugins screen, etc. You can do anything file related to those 1000 sites, install / activate - deactivate, update, edit plugins⦠the themes, functions.php, etc. All while never even visiting ANY of the sites.
And yes you can do pretty much anything database related also, remotely. If there is anything that you want to delve into related to what you asked in your question, definitely wrap your head around and learn to use wp-cli! Youāll get things done in mere seconds vs hours!
Iām sure these are all nice tools, but the first and most important thing I was hoping to find out is exactly what needs migrating from development to production without overwriting any new production data.
I always found migration/deploy in wordpress a PITA ,so iām curious about your WP-CLI usage suggestionā¦
In practical you workflow is ā¦
# create a mysql dump to file
... (omitted)
# connect via ssh to "destination" website
...
# copy mysql dump from local to "destination"
...
# copy wp-content from local to "destination"
...
# restore the db in "destination"
mysql āuser=āuserā āpassword=āuserā < /var/lib/mysql-db-exports/dump.sql
# search and replace in "destiation"
wp search-replace 'https://my-site.local' 'http://my-live-domain-com'
ā¦or there is something Iām missing?
Iām also wondering if did you found a simple solution to automate the process or instead the easy way is to do it manually command by command ?
The problem is that while you are developing on a different machine, there may/will be more data (i.e. orders) being added in production, which you do NOT want to overwrite by doing a simple database dump from development into production. You have to be a bit more selective.
The question is, which tables and files need to be updated, and can this be done without breaking anything else, like referential integrity?
Hey⦠well it ultimately depends on what your doing āspecificallyā. Iāve learned to utilize bash scripts, for example, combines many of the commands you have listed. Using bash itās actually possible to just diff a db against another db⦠say a staging db and production db⦠and only push changes you want⦠or examine a --dry-run first, and then push changes, not even having to do sql dumps.
I also use alot of automation (winautomation, now defunct but Iāve used it and really know it well) and connect directly to many DBs using Navicat.
Winautomation** isnāt defunct, it was brought by MS and has been built into Windose now. Of course missing a couple of killer features such as building a stand alone exe to distribute your automation. Still perfectly usable IF you use a windows PC.
** Assuming we are talking about the same product - everything seems to have the same names these days.
I meant Winautomation as it was before MS. I thought they changed the name⦠but I love it and did so much with it through the years.
And yes yes yes, the ability to kick out exe is major. There was a guy back when their forum was open that had installed EXEs on aws ec2 windows server doing some amazing stuff! Funny you mentioned exe, itās making me wonder how I could possibly still use it now lol.
I donāt think so. You have a production database and file system that will have new data and files that you donāt have in the development database and file system (e.g. orders, uploads, statistics, ā¦) and you may/will have development data and files that you donāt have in the production database and file system (e.g. templates, settings, uploads, ā¦).
You need to sync the databases and file systems in both directions without breaking anything. A simple diff will not do that, perhaps a limited diff if and when you know which tables and folders to diff in each direction.
And that is the question in the OP, not the tools to diff (I can list all 574 tools myself), but the knowledge of what to diff in each direction.
Right⦠I was just giving a VERY broad view. Obviously, when you are talking about something so granular then yea itās gonna take some thought.
Look at your original post itās very broad about what people use for staging / production and making changes. And thatās where I mentioned the benefits of WP-CLI vs using yet another plugin + multiple clicks and admin screens + the time of that method⦠doesnāt come close to the accuracy and FAR less time it takes to do those ābroad thingsā like you original asked.
Now, even as you get more granular and are talking about specific tables, etc. Even the most granular and detailed thing you want to do, can still be done via wp-cli⦠itās gonna take more thought and more knowledge of the needed commands. So with the combination of wp-cli + bash and rsync for moving files from server(s) to server(s)⦠MUCH can be done.
Now ironically, the one most simplest thing I tend to do at admin is manually enter license keys in + refresh permalinks⦠then Iām back out lol
The OP was very clear about the problem I am trying to tackle. Perhaps you should read it a few times and make an effort to understand it, instead of blabbering about your pet tool. Youāre even welcome to start your own wp-cli thread, but please stop derailing this thread!!
Not sure what changes you are referring to. Structural or content? If structural I do my dev on a staging site. If content, then live. For major enhancements or changes my workflow is push live to staging, make changes, push staging to live. I host most of my WP sites on the Gridpane stack which provides staging management (partial or full). For off GP deployments I have a WP Vivid license and use the staging feature or just old fashioned command line. Sridharās recommendation of WP Migrate is good. I just found it slow myself.
Not at this time and probably never since plenty of capable plugins already exist.
If you have more specific questions I will try to answer them.
You have a live woocommerce site, i.e. orders coming in all the time, but you want to develop a new template for the front page. Do you develop this template on the live site, or on a development site?
You may also want to add a few custom fields to your products. Will you add the extra fields to the live data?
And how about installing and testing new plugins? Surely that should be done on a development site first, to make sure it wonāt break anything?