Recovering from a system crash

51 views
Skip to first unread message

Sagar Behere

unread,
Aug 20, 2015, 6:50:03 AM8/20/15
to scmmanager
Hi,

The computer which was running our SCM Manager installation had a
hardware hard-disk malfunction, and most data is lost irrecoverably.

The actual repository contents were stored on a network drive mounted on
that computer and these repository contents are still available. I can
mount the network drive on my local computer, and do local svn and git
checkouts. However, the meta-data associated with the repositories, like
users, is lost.

I am re-creating SCM Manager installation on a fresh computer. Will also
re-create user accounts in the new installation.

Question: Is there a way to just point the new SCM Manager to the old
repositories, so that it can realize, "Hey, I see repositories here..
these are mine." and start functioning? Or is this not possible without
the meta-data associated with the repos? (like the contents of the .scm
folder.. the install was on Linux)

Is it possible to recreate the repositories such that the history
information (commits etc.) is still available.

Thanks in advance,
Sagar

Chuck Boecking

unread,
Aug 21, 2015, 9:20:37 AM8/21/15
to scmmanager, sagar....@gmail.com
This is a great question and an unfortunately situation. The purpose of this post is to help make sure you do not get in this situation in the future. Will the group please confirm the below will work? The below assumes you are using linux. Here are my thoughts:
  1. FYI - Here is a post on how to backup your SCM repos offsite 
  2. If you were to create a repository out of the /var/lib/scm/ directory and add it to your scmManager, you would effectively be backing up your scm instance to scm itself.
  3. If you were to modify the above backup script to also regularly commit and push your /var/lib/scm/ directory, then you would have an offsite backup of your scm installation.
  4. In the event of disaster recovery, you would [a] install scm on the new server, [b] recover your /var/lib/scm/ from your offsite backup.
The questions are:
  • Is there anything else you need to backup from the local machine (other than /var/lib/scm/ and the repos themselves)?
Thanks for your consideration.

Chuck Boecking


The other benefit of the above solution is that you can [a] see what changed and [b] undo any change made to /var/lib/scm/ at any time.

Sagar Behere

unread,
Aug 21, 2015, 9:41:58 AM8/21/15
to Chuck Boecking, scmmanager
Hi All,

I solved my problem after discovering the "import repository" feature of
SCM Manager.

Steps:

1. Mount the network drive on the new computer running a fresh instance
of SCM Manager
2. Start up SCM Manager and point it to the network drive as the
location to keep its repositories.
3. Click on "import repositories"->Select Git/Subversion-> "Import from
directory"
4. SCM Manager then finds the repositories and imports them, together
with all the branches, commit history etc.

The only thing needed after this is to re-create the users and edit each
repository individually to add an owner and other users to it. That is
tedious, but I can live with it :)

Regarding Chuck's approach

(dunno what /var/lib/scm contains.. I am running SCM Manager under its
own user, from the tarball downloaded from the website, and all the SCM
Manager data is in $HOME/.scm. I'm assuming /var/lib/scm contains the
same thing as $HOME/.scm)

It seems to me that there are two parts of the SCM Manager data. 1. The
repositories themselves and their content and 2. Other meta-data like
the users and which repositories they have access to. Both need to be
backed up! In my case, I had backups of 1. but not 2.

Chuck: Your script looks good, but what added benefit do you see of
turning /var/lib/scm into a repository itself? (Apart from seeing what
changed?) The original script should be perfectly fine for restoring in
case your SCM Manager machine goes down.

Regards,
Sagar

On 08/21/2015 03:20 PM, Chuck Boecking wrote:
> This is a great question and an unfortunately situation. The purpose of
> this post is to help make sure you do not get in this situation in the
> future. Will the group please confirm the below will work? The below
> assumes you are using linux. Here are my thoughts:
>
> 1. FYI - Here is a post on how to backup your SCM repos offsite
> <https://groups.google.com/forum/#!searchin/scmmanager/backup$20chuck/scmmanager/bYgTHCWLE9w/Xknaj3LpKr0J>
>
> 2. If you were to create a repository out of the /var/lib/scm/
> directory and add it to your scmManager, you would effectively be
> backing up your scm instance to scm itself.
> 3. If you were to modify the above backup script to also regularly
> commit and push your /var/lib/scm/ directory, then you would have an
> offsite backup of your scm installation.
> 4. In the event of disaster recovery, you would [a] install scm on the
> new server, [b] recover your /var/lib/scm/ from your offsite backup.
>
> The questions are:
>
> * Is there anything else you need to backup from the local machine
Reply all
Reply to author
Forward
0 new messages