1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Changes between Version 30 and Version 31 of SVN adminrepo

Show
Ignore:
Timestamp:
05/29/13 15:28:31 (11 months ago)
Author:
ctsai (IP: 172.29.29.69)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SVN adminrepo

    v30 v31  
    11[[PageOutline]] 
    22 
    3 '''''Note:''''' This documentation is written for the Classic !SourceForge system. Some options for importing a Subversion dump to a New !SourceForge project. See alternatives on this [http://sourceforge.net/p/forge/community-docs/Subversion Community documentation page]. 
     3'''''Note:''''' the SVN adminrepo feature is specifically for the Classic !SourceForge system. For instructions for importing a Subversion dump to a New !SourceForge project, see this [http://sourceforge.net/p/forge/community-docs/Subversion Community documentation page]. 
    44 
    5 Not sure if you have a Classic or Beta project? See [http://sourceforge.net/p/forge/documentation/Classic%20vs%20Beta%20projects/ this guide]. 
     5Not sure if you have a Classic or Allura project? See [http://sourceforge.net/p/forge/documentation/Classic%20vs%20New%20SourceForge%20projects/ this guide]. 
    66 
    7 = Managing your Subversion Repository with adminrepo = 
    87 
    9 While most changes to a [wiki:"What is Source Code Management?" SCM repository] are made through client software on your workstation, most repositories have a certain set of operations which must be performed through direct filesystem manipulation on the server.  To meet these needs for direct repository modification, [wiki:"What is SourceForge.net?" SourceForge.net] provides the adminrepo tool as part of our [wiki:"Shell service" shell service].  adminrepo may be used to perform common tasks, such as permanently removing files or modules that were incorrectly checked in.  Many tasks, such as locking files or setting properties, can be accomplished from your subversion client, and do not require the use of adminrepo. 
    10  
    11 == Before you start == 
    12  
    13 '''NOTE''': Before performing '''ANY''' action with adminrepo: 
    14  1. Consult with your Project Team; ensure all developers are aware of the changes you are making to the repository.  Direct repository changes can result in lost data and lost time for your developers if done improperly. 
    15  1. Make a backup of your repository.  The backups maintained by !SourceForge.net are used only when there is a catastrophic server failure.  If you break your repository using adminrepo, we won't restore the data.  You need to be prepared to restore data using a backup you are making now. 
    16  
    17 [wiki:"Using rsync for backups" rsync] may be used to make a backup of your repository.  For example (replace PROJECTNAME with the UNIX group name of your project): 
    18 {{{ 
    19 rsync -av PROJECTNAME.svn.sourceforge.net::svn/PROJECTNAME/* . 
    20 }}} 
    21  
    22 == Executing adminrepo == 
    23  
    24  1. Connect to our [wiki:"Shell service"] and run the sf-help command.  This will provide you with information you may need later. 
    25  1. Execute the following command to clone a copy of your repository to `/svnroot/PROJECT`: `adminrepo --checkout svn` 
    26  1. Change to the `/svnroot/PROJECT` directory and manipulate the repository as needed. 
    27  1. The repository will be locked and read-only until you either: 
    28      a. Finalize your changes by executing: `adminrepo --save svn` 
    29      a. Cancel your changes by executing: `adminrepo --discard` 
    30  
    31 = Resetting a repo (starting from scratch) = 
    32  
    33  1. Discuss your proposed changes with your Project Team. 
    34  1. [wiki:"Using rsync for backups" Backup your current Subversion repository]. 
    35  1. Connect to our [wiki:"Shell service"] 
    36  1. `adminrepo --checkout svn` will create a clone copy of your repository in /svnroot/PROJECT. 
    37    * Use `adminrepo --help` for further information. 
    38  1. Create a new repository: 
    39    a. Remove the clone copy of your repo with `rm -rf /svnroot/PROJECT/*`.  '''Be very careful with this.''' 
    40    a. Create a new repository with `svnadmin create /svnroot/PROJECT` 
    41  1. Save your changes using `adminrepo --save svn`. 
    42  
    43 = Removing (obliterating) a file or module = 
    44  
    45  1. Discuss your proposed changes with your Project Team. 
    46  1. [wiki:"Using rsync for backups" Backup your current SourceForge subversion repository]. 
    47  1. Connect to our [wiki:"Shell service"] 
    48  1. `adminrepo --checkout svn` will create a clone copy of your repository in /svnroot/PROJECT. 
    49    * Use `adminrepo --help` for further information. 
    50  1. Create a dump file of your repository with `svnadmin dump /svnroot/PROJECT/ > svndump` 
    51  1. Use [http://svnbook.red-bean.com/en/1.0/ch05s03.html#svn-ch-5-sect-3.1.3 svndumpfilter] to make your desired changes, eg. removing a file. 
    52  1. Create a new repository to load the changes from your dump file into: 
    53    a. Remove the clone copy of your repo with `rm -rf /svnroot/PROJECT/*`.  '''Be very careful with this.''' 
    54    a. Create a new repository with `svnadmin create /svnroot/PROJECT` 
    55  1. Use `svnadmin load /svnroot/PROJECT < svndump` to load your changes into the repository. 
    56  1. Save your changes using `adminrepo --save svn`. 
    57  
    58 = Importing from other repos (including other SCMs) = 
    59  
    60 == Creating a dump file == 
    61  Subversion allows you to create backups and imports via dump files.  You can create a dump file in a variety of ways, such as dumping an existing Subversion repository, or using a repository conversion tool, such as cvs2svn. 
    62  
    63 === Creating a dump file from another SVN repo === 
    64  
    65  1. Discuss your proposed changes with your Project Team. 
    66  1. Use `svnadmin dump /PATH/TO/REPO > svndump` to create a dump file named "svndump". 
    67  1. It is a good idea to compress the resulting dump file, to save space. We support zip, bzip2, and gzip compression (do not tar it). 
    68  
    69 === Using cvs2svn to create a SVN dump file from CVS content === 
    70  
    71 If you have an existing CVS repository that you would like to convert to Subversion, follow these instructions: 
    72  
    73  1. Discuss your proposed changes with your Project Team. 
    74  1. Download and install a copy of [http://cvs2svn.tigris.org/ cvs2svn]. 
    75  1. Get a copy of the RCS files for the CVS repository.  For !SourceForge.net-hosted CVS repositories, this can be [wiki:"CVS#Backups" done via rsync].  For projects hosted elsewhere, you may need to contact the repository administrator for a copy of the files. 
    76  1. Convert the repository to a Subversion dump file using cvs2svn: 
    77    a. Go to the directory at the root of the CVS repository 
    78    a. Run the command: `cvs2svn --dumpfile=svndump .` 
    79  1. If the conversion generates an error message, follow the prompts that indicate what the problem is, and attempt to resolve them using one of the various options for cvs2svn (--trunk-only will drop all branches and tags, which will usually make the process painless if all you need is the trunk). 
    80  1. It is a good idea to compress the resulting dump file, to save space. We support zip, bzip2, and gzip compression (do not tar it). 
    81  1. Follow the instructions for importing a Subversion dump file to finish the import. 
    82  
    83 == Filtering the dump file (optional) == 
    84  
    85 You can remove files, modules, or revisions from the dump file using [http://svnbook.red-bean.com/en/1.5/svn.reposadmin.maint.html#svn.reposadmin.maint.tk.svndumpfilter svndumpfilter].  It is important to make sure you do this before the import; data cannot be readily removed from a Subversion repository after being imported, unless you do another, filtered import in the future. 
    86  
    87 == Importing the dump file == 
    88  
    89  1. Discuss your proposed changes with your Project Team. 
    90  1. [wiki:"Using rsync for backups" Backup your your current Subversion repository]. 
    91  1. Make sure that the name of the dump file only contains alphanumeric characters and a period (Example: svndump.gz is good, but projectname-svndump.gz is bad, due to the dash). 
    92  1. Connect to our [wiki:"Shell service"] and run the sf-help command.  This will provide you with the information necessary to upload your dump file. 
    93  1. Upload the dump file to the [wiki:"Shell service#Accessingyourshellwithothertools" interactive shell]. 
    94  1. `adminrepo --checkout svn` will copy your repository to /svnroot/PROJECT so you can work with it from there. 
    95    * Use `adminrepo --help` for further information. 
    96  1. Decompress your dump file (e.g. gzip -d svndump.gz) 
    97  1. To completely replace your current repo, follow the sub-steps listed here.  Otherwise, skip this step. 
    98    a. First remove your the clone copy of your current repo with `rm -rf /svnroot/PROJECT/*`. '''Be very careful with this.''' 
    99    a. Create a new repo with `svnadmin create /svnroot/PROJECT/` 
    100    a. Proceed to the next step. 
    101  1. Use `svnadmin load /svnroot/PROJECT < svndump` to insert your dump file into your current repository. 
    102  1. Save your changes using `adminrepo --save svn`. 
     8If you still need the historical instructions, check [wiki:"SVN adminrepo?version=30" an older revision] of this wiki page. 
    1039 
    10410