Backing up Confluence PostgreSQL to Google Drive
Edit: gdrive has been updated to V2. This new post covers using it.
I had a Dokuwiki instance running at home, but I decided to migrate to Confluence instead to make it easier for non-technical people to use. The Dokuwiki product is super easy to back up, as it’s entirely file-system driven. Confluence, however, is not so straightforward as it has the content stored in both a database and the filesystem.
In my case I’ve got my Confluence instance attached to PostgreSQL, so this article is suited for that. It shouldn’t be hard to translate it for other DBMS platforms though. In addition, I’ve only got a single instance running so I don’t know if this would be suitable for a clustered environment. Consult the product documentation for more info.
I’m using Google Drive (see my previous article on connecting a CentOS 7 box to gdrive) as the backup destination here, and I now have the backup being pushed into a specific folder (many thanks to Steven for pointing out how to upload to specific directories).
Also I’m encrypting the backup before it goes into the cloud. Always encrypt your data before it leaves your environment.
So this is my backup script, stored as /scripts/daily-backup.sh
:
1 |
|
And finally to get the script running daily at 4AM:
1 | chmod 500 /scripts/daily-backup.sh |