Stash Datacenter restored from DIY backup

We customized DIY backup script that take backup of Postreges database using pg_dump and Stash "shared" folder present inside stash home directory. Other folders and files inside stash home are not taken backup for three reasons, one they are only temp files, logs, and cache data also not suggested by atlassian to include in the backup of stash home directory, two it may vary between multiple instances of stash datacenter, three our shared folder inside stash home is NFS mounted and has ability take snapshot backup that is pretty fast and we don't care other files in stash home for reason one & two.

When we restore Stash from back, we create empty stash home directory and copy shared folder inside home from our backups. Postgres database is restore using standard pg_restore procedure. Once we start Stash on these restores, we see Stash home directory's temp files & folders are automatically populated except changing anything on "shared" folder, also Stash is started as usual.

However above experimented restore procedure is not documented as is on Atlassian restore documentation from DIY backups. I would like to know from Atalassian, Am I missing anything in the above explained backup and restore process that will create serious impacts down the line.

If it looks a standard way to do, can this be documented on DIY backup store documentation for other reference?, because pretty useful to know for Stash datacenter backup and restore process.

2 answers

1 vote

Hi @Anand Meyyappan,

everything you have described in your question sounds reasonable. 

It also sounds a lot like what the Stash DIY Backup scripts do for you already. 

If you use stash.diy-backup.sh to backup a Postgres database, the script will do it using pg_dump. One thing you did not mention is locking Stash before doing your backup. If you are using/building off of the provided scripts, this will be done for you.
Snapshotting the NFS mount (with only the shared folder) is fine, as long as you do not care about losing your instance's logs.  - You indicated you don't care about that.

Likewise if you restore a postgres backup using the stash.diy-restore.sh script, it will use pg_restore to restore the database. As you correctly identified, Stash will start with just the shared directory in place, and reconstruct the rest of the home directory when it is started.

It sounds like you are manually doing what the backup and restore scripts automate, but everything is valid and you should not have any issues continuing with the backup & restore procedure you've described.

As for documentation: all this is "documented" in the scripts - due to the various different configurations Stash can be run with, it does not make sense to document each case individually - that's why it's called the "do-it-yourself" backup - you've ultimately got full control of what and how you want to backup. The scripts provided should serve as a helpful starting point for that.  

I hope this helps,

Felix

Hi Flex, 

Thank you for your comments.

The DIY scripts that we have are actually customized from DIY backup scripts (Bash scripts) offered by Atlassian's open-source development on bitbucket. So we have all the locking, unlocking, backup progress notification, etc., from upstream implementation. We changed tool that backup stash home, and backup only the shared folder inside home directory.

-Anand

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

161 views 20 8
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you