Backup, restore, and porting of SVN version libraries (primary, intermediate, and advanced)

Source: Internet
Author: User
Tags svn

Primary article:

Porting of version Library data: Svnadmin dump, svnadmin load

Export:

$svnlook youngest Myrepos//view the latest version number so far

$svnadmin dump Myrepos > DumpFile//Export the specified version library to a file dumpfile

Import:

$svnadmin Load Newrepos < DumpFile

<?xml:namespace prefix = o ns = "Urn:schemas-microsoft-com:office:office"/>

Intermediate article:

$svnadmin dump Myrepos–r >rev-23.dumpfile//VERSION23 Export

$svnadmin dump Myrepos–r 100:200 >rev-100-200.dumpfile//version100~200 Export

A larger library can be decomposed into several file exports for easy backup

$svnadmin Dump Myrepos–r 0:1000 >0-1000.dumpfile

$svnadmin dump Myrepos–r 1001:2000--incremental >1001-2000.dumpfile

$svnadmin dump Myrepos–r 2001:3000--incremental >2001:3000.dumpfile

When importing, you can load these backup files into a new version library

$svnadmin Load Myrepos < 0-1000.dumpfile

$svnadmin Load Myrepos < 1001-2000.dumpfile

$svnadmin Load Myrepos < 2001:3000.dumpfile

Advanced article:

Filter Version Library History:

Suppose there are three versions of the project library

/rigtms

/docprotect

/odin

Now you need to transfer these three projects to a separate three-version library, and you need to do the following

1, dump the entire version of the library

$svnadmin Dump/path/to/repos > Repos-dumpfile

2, will dump file three times filter, only keep a grading directory, that is, you can get three dump files

$svndumpfilter include Rigtms < repos-dumpfile > Rigtms-dumpfile

$svndumpfilter include Docprotect < repos-dumpfile > Docprotect-dumpfile

$svndumpfilter include Odin < Repos-dumpfile >odin-dumpfile

3, although now Rigtms, Docprotect, Odin can be used to create an available version library, but they retain the original version of the library's exact path structure (for example: Rigtms the top-level directory for/rigtms/trunk,/rigtms/branches,/ Rigtms/tags, rather than what we need/trunk,/branches,/tags), if you want to achieve the goal, you need to edit the dump file, adjust the Node-path and Copyfrom-path header parameters, and delete the path/RIGTMS. Also, dump the portion of the data to create the RIGTMS directory.

Node-path:rigtms

Node-action:add

Node-kind:dir

content-length:0

Special attention points: If you use a manual edit DumpFile file to remove a top-level directory, you need to be careful not to allow the editor to convert line breaks to local format (for example, convert/r/n to/n), otherwise the contents of the file do not match the original format, and the dump file is invalidated. The way to do this is when you open a file using the editor, the editor prompts the user for the conversion format, so be sure to choose "No" and remember. Remember..

4, Next is to create three new version library, and then the new filtered out and modified three dump file import

$svnadmin Create Rigtms;svnadmin load Rigtms < Rigtms-dumpfile

$svnadmin Create Docprotect;svnadmin load Docprotect < Docprotect-dumpfile

$svnadmin Create Odin;svnadmin load Odin < Odin-dumpfile

Backup Environment Note points:

1, to ensure that no other process access to the version library, turn off Apache, Svnserve services

2, as the administrator of the version library, if you restore the version library as a different identity, you may change the access rights of the version library file, resulting in the recovery still inaccessible

3, Svnadmin Recover/path/to/repos

4. Restart the service process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.