Backup, restoration, and Transplantation of SVN version libraries (elementary, intermediate, and advanced)

Source: Internet
Author: User

Elementary:

 

Transplantation of version library data: svnadmin dump and svnadmin Load

Export:

$ Svnlook youngest myrepos // view the latest version so far

$ Svnadmin dump myrepos> dumpfile // export the specified version library to a file dumpfile

Import:

$ Svnadmin load newrepos <dumpfile

 

Intermediate:

$ Svnadmin dump myrepos-R 23> rev-23.dumpfile // export version23

$ Svnadmin dump myrepos-r 100:200> rev-100-200.dumpfile // convert version100 ~ 200 Export

Large databases can be decomposed into several files for export, facilitating backup

$ Svnadmin dump myrepos-R 0: 1000> 0-1000.dumpfile

$ Svnadmin dump myrepos-r 100:2000 -- incremental> 1001-2000.dumpfile

$ Svnadmin dump myrepos-r 200:3000 -- incremental> 200:3000. dumpfile

During import, you can load these backup files to a new version library.

$ Svnadmin load myrepos <0-1000.dumpfile

$ Svnadmin load myrepos <1001-2000.dumpfile

$ Svnadmin load myrepos <200:3000. dumpfile

 

 

Advanced:

Filter version library history:

Assume that there are three project version libraries.

/Rigtms

/Docprotect

/Odin

You need to transfer these three projects to the independent three version libraries.

1. Dump the entire version Library

$ Svnadmin dump/path/to/repos> repos-dumpfile

2. filter the dump file three times. Only one rated directory is retained at a time to obtain 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 rigtms, docprotect, And Odin can be used to create an available version library, they retain the exact path structure of the original version Library (for example: the top-level directories of rigtms are/rigtms/trunk,/rigtms/branches,/rigtms/tags, rather than what we need/trunk,/branches,/tags ), to achieve the goal, edit the dump file, adjust the node-path and copyfrom-path header parameters, delete the path/rigtms, and create the rigtms directory in the dump data.

Node-path: rigtms

Node-Action: add

Node-kind: Dir

Content-Length: 0

* *** Note: If you manually edit the dumpfile file to remove a top-level directory, note that the editor should not convert the linefeed to the local format (for example, convert/R/N to/n). Otherwise, the content of the file is inconsistent with the original format, this dump file becomes invalid. When you open a file using the editor, the editor prompts you whether to convert the format. Make sure to select "no". Remember !! Remember !!

4. Create three new version libraries, and then import the three modified dump files.

$ Svnadmin create rigtms; svnadmin load rigtms <rigtms-dumpfile

$ Svnadmin create docprotect; svnadmin load docprotect <docprotect-dumpfile

$ Svnadmin create Odin; svnadmin load Odin <Odin-dumpfile

 

 

* ** Note:

1. Make sure that no other process accesses the version library and disable the Apache and svnserve services.

2. Become the version library administrator. If you restore the version library as another identity, the access permission of the version library file may be changed, resulting in unavailability after restoration.

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.