Block Patterns are pre-defined groups of blocks curated by a WordPress theme or plugin developer and I have put off learning to build these for a few months until a case presented itself.
Previously I used WP_Query in a Child Theme to display posts of a special category to generate these call to action titles. It was cumbersome and whenever the client needed to update the page I’d have to edit the theme. Today, four years since the Block Editor arrived we can finally configure complex groups of blocks for our clients to drop any post. That’s significant workflow enhancement.
In a future release I expect users could build their own patterns within the editor itself and save them to a library just as we can with Reusable Blocks. I’m kinda curious why that ability doesn’t already exist.
It quickly creates a snapshot of the database but I needed an efficient way to manage my wp-content folder where WordPress saves all my themes, plugins and media files. This is where duplicity comes in.
While logged into my website via ssh I use a simple command to create and update an archive of my wp-content folder and save it just out of public reach.
Note: My website’s setup uses /var/www/html as the public folder and /var/www/ is not shared by my apache web server.
Duplicity quickly updates a snapshot of my wp-content folder.
As you can see above, the archive is 649 MB but nothing new was added since the last backup a few minutes earlier. This is key, only changes are recorded and it doesn’t duplicate files that haven’t changed.
In practice I run a duplicity backup every time I perform a database backup. This allows me to restore static files along the database.
Duplicity would have been perfect for restoring that plugin I deleted six months ago ::smh::
Joseph Dickson – a month ago
Why I Love Duplicity
A few months back I had deleted a WordCamp slide presentation that accompanied my session on WP_Query. I didn’t have this workflow in place and it would have saved me a lot of time. I could have simply restored the missing files along with the database to my local testing server.
As duplicity’s archive grows I will probably prune it along with my webhost’s log files to keep my Ubuntu droplet nice an lean.
Over the next few months I may even go as far to run a cron job that updates the duplicity backup and the WordPress database so all I need to do is log in to download them. 😉
Offline and Duplicate Backups
Below is an example of an local archive I earlier today which includes the duplicity backup, MySQL database, wp-config.php and .htaccess that can be used to clone or restore my website at another location. 😀
Most importantly I can store this on my desktop where I run daily backups and copy it to a USB flash drive in the event my webhost, computer crash on the same day I’ll still have a third offline backup.
Why Backup Manually?
I wanted to take a more personal and intentional approach to backing up this website and canceled my Jetpack account a few months ago which provided flawless daily backups and restoration via VaultPress.
Jetpack has a lot of features I really didn’t use or appreciate so taking on the challenge of keeping my own local archive of my website seemed like a good idea. I now backup my website’s backups along with my desktop and laptop 🙂