It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Stash Datacenter restored from DIY backup

Anand Meyyappan Aug 06, 2015

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
Felix Haehnel Atlassian Team Aug 06, 2015

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

0 votes
Anand Meyyappan Aug 07, 2015

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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

3,011 views 1 20
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you