[Stash] How to backup specify repositories in Stash

Wei Wang August 25, 2013

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

1 vote
seb
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 12, 2013
0 votes
letrung December 27, 2015

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;

0 votes
Wei Wang September 12, 2013

any update?

0 votes
Wei Wang August 29, 2013

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

Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 13, 2013

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

0 votes
Wei Wang August 25, 2013

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

Stefan Saasen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 26, 2013

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

0 votes
Stefan Saasen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 25, 2013

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events