Difference between revisions of "Subversion backup and restore"

From ArchWiki
Jump to: navigation, search
m (Bot: Removing from Category:HOWTOs (English))
(add i18n. Poor writing flag mainly for format and style concerns Talk:Subversion backup and restore)
Line 1: Line 1:
[[Category:Development (English)]][[Category:Networking (English)]]
[[Category:Development (English)]][[Category:Networking (English)]]
{{i18n|Subversion backup and restore}}
{{Poor writing}}
* Howto backup Subversion and move it to a new machine.
* Howto backup Subversion and move it to a new machine.
* <b>Back Up Your Data !</b>
* <b>Back Up Your Data !</b>

Revision as of 03:04, 9 September 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements. See Help:Style for reference.Tango-edit-clear.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Subversion backup and restore#)
  • Howto backup Subversion and move it to a new machine.
  • Back Up Your Data !
  • svnadmin dump repo and scp to other machine.
  • Do this for each repository you have.
svnadmin dump /path/to/reponame > /tmp/reponame.dump ; scp -rp /tmp/reponame.dump user@server.domain.com:/tmp/
  • On other machine install subversion
pacman -S subversion
  • Make sure you set svnserve in /etc/rc.conf
  • Edit the DAEMONS line so it starts on next boot.
DAEMONS=(syslog-ng hotplug !pcmcia network netfs crond sshd svnserve httpd)
  • Create the corresponding repositories.
  • Do this for each repository you have.
svnadmin create /path/to/reponame
  • Load svn dump into new repo on new machine.
  • Do this for each repository you have.
svnadmin load /path/to/reponame < /tmp/repo1.dump
  • Setting Permissions.. CRUCIAL
  • This is the most common mistake when moving an svn repo.
  • Do this for each repository you have.
chown -R svn:svnusers /path/to/reponame ; chmod -R g+w /path/to/reponame/db/
  • Sample Permissions:
bash-2.05b# ls -l | grep svn
drwxrwxr-x   7 svn   svnusers      512 Apr 27 15:06 reponame1
drwxrwxr-x   7 svn   svnusers      512 Apr 27 15:06 reponame2
drwxrwxr-x   7 svn   svnusers      512 Apr 27 15:06 reponame3
bash-2.05b# ls -l reponame1/ | egrep -i "db"
drwxrwsr-x  2 svn  svnusers  512 Apr 27 15:07 db
  • Ok these repos should be all set and ready to rock.. however using svn+ssh:// will not work..
  • Note: we have to have a wrapper written for svnserve..
  • check your ENV like:
bash-2.05b# env | egrep "^PATH="
  • check where the svnserve binary is located:
bash-2.05b# which svnserve
  • ok our wrapper is going to have to fall in PATH prior to this location.. /sbin is a good place seeing its our 1st exec path on the system as root.
  • create wrapper:
touch /sbin/svnserve ; chmod 755 /sbin/svnserve 
  • now edit it to look like so:
bash-2.05b# cat /sbin/svnserve 
# wrapper script for svnserve
umask 007
/usr/local/bin/svnserve -r /path/to "$@"
  • NOTE: see the -r /path/to ?? well this is what makes use of the svn co svn+ssh://server.domain.com:/reponame ( SEE THIS :/reponame ).. this sets root PATH.
  • you do not need to do: :/path/to/reponame.... this is the big trick here folks.
  • Start svnserve with new wrapper script like so:
/sbin/svnserve -d  ( start daemon mode )
  • check it with ps:
bash-2.05b# ps auxww | grep svn
root   66668  0.0  0.1  3608 1868  ??  Is   12:25AM   0:00.00 /usr/local/bin/svnserve -r /path/to -d
  • we can also check the perms for remote users like this:
cdowns:~ ~$ svn ls svn+ssh://server.domain.com:/reponame
cdowns:~ ~$
  • Thats it !
Thats it ! 

Extra Docs:
  • cdowns\@drippingdead.com