Converting a CVS checkout to SVN

From WeBWorK_wiki
Jump to navigation Jump to search
This article has been retained as a historical document. It is not up-to-date and the formatting may be lacking. Use the information herein with caution.
This deprecated feature should no longer be used, but is still available for reasons of backwards compatibility.

This feature was deprecated in version 2.6. For up-to-date information view Github. 9

See also: History of WeBWorK version control

If you have not made any changes to the WeBWorK code, then it is easy to switch change your CVS checkout to an SVN checkout by overwriting everything with a fresh checkout. The procedure given here will keep your local files, such as global.conf. Also, it will not affect anything outside of your webwork2, pg and NationalProblemLibrary directories. (In particular, it will have no effect on your courses directory.)

Back up your current WeBWorK directories[edit]

Before getting started, make copies of your webwork2, pg and NationalProblemLibrary directories as webwork2_cvs, pg_cvs and NationalProblemLibrary_cvs.

Converting the current stable release branch[edit]

If your installation is run on the current stable release, follow these instructions:

First, convert your webwork2 directory:

svn co temp-checkout
rsync -a temp-checkout/ /path/to/webwork2 directory/
rm -rf temp-checkout

Second, convert your pg directory:

svn co temp-checkout
rsync -a temp-checkout/ /path/to/pg directory/
rm -rf temp-checkout

Third, convert your NationalProblemLibrary directory:

svn co temp-checkout
rsync -a temp-checkout/ /path/to/NationalProblemLibrary directory/
rm -rf temp-checkout

After these three steps, you will have converted your WeBWorK CVS installation to a Subversion installation.

Now make sure everything is working, and if so then you can delete your backup copies webwork2_cvs, pg_cvs and NationalProblemLibrary_cvs. (Maybe wait a few days for good measure.)

If anything does go wrong, it is most likely due to the permissions changing on webwork2/DATA and/or webwork2/htdocs. See below.

Note: In the rsync commands above, it is important that you use temp-checkout/ rather than temp-checkout. This subtlety about using rsync is explained in the man page for that command: A trailing / on a source name means "copy the contents of this directory". Without a trailing slash it means "copy the directory".

Converting from the CVS HEAD[edit]

If your WeBWorK installation was tracking the HEAD under CVS, then when you convert to Subversion you may want to now track the current development trunk. To convert to the current development trunk under Subversion, do exactly the commands above, except replace /branches/rel-2-4-patches/ with /trunk/. That is, do

svn co temp-checkout
rsync -a temp-checkout/ /path/to/webwork2 directory/
rm -rf temp-checkout

And repeat for the pg and NationalProblemLibrary directories.

Cleaning up[edit]

The CVS version control system will have installed special subdirectories labled "CVS" in your versioned directories. Since you won't be using CVS any longer, it is not necessary to keep these directories. So, if you want to get rid of the old CVS directories, do:

find . -type d -name CVS -print0 | xargs -0r rm -rf

This should be done from the top level directory containing your WeBWorK installation (typically /opt/webwork).

Be careful with this command because if that command is executed from any higher directory, it may delete CVS directories from other projects which you did not intend.

No harm will be done either by leaving the CVS directories or by properly removing them. Note that SVN will install it's own special (but hidden) directories labled ".svn". SVN requires those directories to function properly, so don't remove or modify them.


Warning : The '-a' flag to rsync is supposed to preserve filesystem permissions. However, two users reported that the webwork2/DATA directory permissions needed to be reset after following this procedure. This was reported on FreeBSD and on Fedora. If you encounter this or any other issue while following this procedure, please report it in the Installation forums or the discussion page for this article.

Also, you can follow the relevant portion of the installation instructions to reset the permissions if necessary.

See also[edit]