[Stash] How to backup specify repositories in Stash

Hi,

We are using Stash to manage our git repositories, and we just want to backup some of them.

But the repositories are stored in Stash by number, but not repository name. So how to backup specify repositories?

----------------------

[root@stash data]# pwd

/var/atlassian/application-data/stash/data

[root@stash data]# ll repositories/

total 52

drwxrwxr-x 7 stash stash 4096 Aug 13 09:57 1

drwxrwxr-x 7 stash stash 4096 Aug 13 15:32 11

drwxrwxr-x 7 stash stash 4096 Aug 13 15:38 12

drwxrwxr-x 8 stash stash 4096 Aug 19 18:07 13

drwxrwxr-x 7 stash stash 4096 Aug 19 18:01 14

drwxrwxr-x 7 stash stash 4096 Aug 19 18:01 15

drwxrwxr-x 7 stash stash 4096 Aug 19 18:18 16

drwxrwxr-x 7 stash stash 4096 Aug 13 09:57 2

drwxrwxr-x 7 stash stash 4096 Aug 21 17:34 21

drwxrwxr-x 7 stash stash 4096 Aug 21 17:35 22

drwxrwxr-x 8 stash stash 4096 Aug 13 09:57 3

drwxrwxr-x 7 stash stash 4096 Aug 13 09:57 4

drwxrwxr-x 7 stash stash 4096 Aug 13 09:57 5

--------------------------

Thanks!

Br, Wayne

6 answers

0 vote

Hi Wayne,

The https://marketplace.atlassian.com/plugins/com.atlassian.stash.plugin.repository-sysinfo-plugin plugin will give you the repository path on disk which would allow you to map the repository to its internal ID. Note: As of Stash 2.7 that plugin is bundled and doesn't need to be installed explicitly.

Another option would be to use our REST API (https://developer.atlassian.com/static/rest/stash/2.7.0/stash-rest.html) to find out what the internal ID is for the repositories you are interested in.

Does that help or are you looking for something else?

Cheers,

Stefan

Thanks!

For sysinfo-plugin, it looks like good.

But my finaly purpose is that i want to back up STASH.

We have some repositories, and some of them are very large and they are not important. so i want to skip those repositories during backup.

And i am only compress those repositories and save to remote server, when i need to restore, if uncompress those repositories and overwrite old directories?

Thanks!

Br, Wayne

Hey Wayne,

For a consistent backup it's important to ensure that the repository contents and the content in the database match.

In Stash 2.7 we released a backup client that solves this consistency problem: https://confluence.atlassian.com/display/STASH/Stash+2.7+release+notes) - have you had a chance to see whether this fits your requirements?

Cheers,

Stefan

Hi,

Thanks, i have upgraded to V2.7. I have many repositories managed by Stash.

But we just want to know how to backup some of them (specify)? because of the "stash backup clinet" will backup all repositories by default.

Thanks!

Br, Wei Wang

Unfortunately, the backup client does not support backing up only some repositories (yet).

I would suggest creating a feature request for it in the STASH project on http://jira.atlassian.com.

Cheers,

Michael

any update?

you can use Mysql query to show name matched ID , as bellow : 1. Check the repository ID: SELECT id FROM repository WHERE name='<reponame>'; 2. If you want list all: SELECT id,name FROM repository WHERE name is not null;

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 06, 2018 in Bitbucket

Do you use Bitbucket Cloud and Jira Cloud? If so, let us know!

Hi Community, I'm Julia and I'm on the Jira Software Cloud marketing team!  We're looking for companies or teams using Bitbucket Cloud and Jira Software Cloud. If your team fits the t...

70 views 2 3
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