Archive

Archive for January, 2011

And backing up gitorious

January 31st, 2011 No comments
On Wed, Dec 30, 2009 at 5:09 PM, Benjamin Podszun <
benjamin.pods...@gmail.com> wrote:

> What I want to know: How do you backup the whole stack?
>
> I could easily drop nightly pulls for each repository on a tape.
> I could easily backup the database the same way.
>

That should be sufficient, just keep your configuration files too.


> But - is that enough? And how would I reconstruct the environment? The
> repositories have cryptic (hashed) names.
>

The database contains the hashed paths for the repositories, mapping things
like "gitorious/mainline.git" to the hashed names.


> The database has overlaps with the filesystem (it contains the ssh
> keys, but what happens if the git user's authenticated_keys2 is empty
> because I just set the machine up again?) where I can see potential
> problems.
>

Extracting the ssh keys from the database to the authorized_keys file is
done by the ssh_key_processor script, which again calls out to the SshKey
class. Provided you have the poller script running, entering something along
the lines of:

  SshKey.all.each(&:publish_creation_message)

would put messages on the message queue that, when processed, would add the
key to the authorized_keys file.


> I wouldn't know how to import source and wiki content back into
> gitorious, without a lot of struggle and cursing. Did anyone something
> like that before? Is there a guide out there, that I missed? Any
> scripts, experiences, ideas? I'd hope that the gitorious.org service
> has something like this in place. How is it done?
>

The wikis are Git repositories too, so restoring the database and
repositories from a backup to the same file system locations as before
should "just work". Just make sure you keep a backup of your configuration
files too, in case you forget...

Regards,
Marius

--

You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To post to this group, send email to gitori...@googlegroups.com.
To unsubscribe from this group, send email to 
gitorious+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/gitorious?hl=en.
Tags:

Gitorious

January 31st, 2011 No comments

Having spent some time battling with gitorious found a nice script here, (b)logging for my own reference:

Public Clone URL: git://gist.github.com/716108.git
Tags:

Nice one – dump part of SVN repo

January 26th, 2011 No comments

Today at work at Fronde I needed to create a dump of a ‘project’ inside a repository. Our SVN setup is to have one repo per team and then within there have a folder for each client/project. In this case I was providing the backup to a client so it was vital that I gave them just their code and not the whole repo.
So my SVN repo was like this:
/
teamA
clientA
clientB
teamB
clientC


To dump the clientA history into a portable, re-creatable format, I used svnadmin dump, like this:
svnadmin dump [path to repo] > repo.dump


Which creates a dump of the entire repository into a file called repo.dump. This took about 10 mins with 1000 versions and used 100% CPU so it would be best to perform this outside of normal work hours. You have been warned!
I then used svndumpfilter (tutorial) to filter just for the ClientA folder (see folder tree above):
svndumpfilter include clientA < repo.dump > clientA.dump


If you have nested repositories, then it breaks with a syntax error. To get around this you need to run the dump multiple times using the ‘exclude’ directive until you have what you want:
svndumpfilter exclude clientB < repo.dump >> clientA.dump
svndumpfilter exclude clientC < repo.dump >> clientA.dump


This didn’t take very long and at the end I had a full svn repository that could be re-created anywhere. To prove the point I installed SVN on my mac and created the repository. I then loaded the dump file into it and it worked beautifully
svnadmin create /Users/Dave/ClientA
svnadmin load /Users/Dave/ClientA < ClientA.bak
mkdir /Users/Dave/ClientA-checkout
svn co file:///Users/Dave/ClientA clientA-checkout/


Now that you have checked it, you can delete the whole repo backup file (mine was massive) Repo.svn-dump in my case.
Easy as pie once you know how. The fact that you can’t specify the filter at dump-time is non-intutative, clunky and frankly a waste of space. However if you only need to do it once it works and produces a very nice result. Open Source and Open Standards FTW

Taken from: http://daveharris.wordpress.com/2008/08/05/svn-dump-parts-of-a-repository/

Tags: , ,