When I used wpcli to import the database from one environment to another I saw there is an error on the website related to database. When it is frequent to move your database content from one environment to another what is the best way to do it without the downtime? Considering that database size around 5G. Is it possible to copy only the content or diff using cli? What’s your experience in this?
Have you tried Updraft Plus Backup & Restore plugin? Allows moving just the database, but can also backup the entire website (themes, plugins, uploads).
Large databases should be executed in chunks, ie. 1000 queries per iteration.
Updraft likely handles that on its own, the chunking. But I haven’t tried it with large database up until now, so you’ll have to check.
You should put your website into Maintenance mode first (get the maintenance mode plugin).
Make a full backup of the live website using Updraft first.
Then attempt to restore your new database to the live website.
The Premium version of Updraft also allows making a diff between backups, so you only move the diff files to live.
Also, look at the SweepPress plugin to first discard unnecessary database records (ie. log files, orphans, etc), see if you can get the size of the database down before moving it.
I m looking for a command line option here, one possible solution could be wp migrate by delicious brains. But it’s expensive.