Migrate from Git to SVN on Fedora server

2024-05-21 Thread Jeffrey Walton
Hi Everyone,

I'd like to migrate some source code from Git to SVN on my Fedora
server. The rub is, I'd like to use Nginx instead of Apache.

I think I can switch the repo from Git to SVN by performing the
following at the server:

cd /var/test-src
find . -name '.git' -exec rm -rf {} \;
svnadmin create /var/test-src

That should stand up the SVN server on the existing source code (that
was formerly under Git). Also see
.

What I am less sure about is, how to put a Nginx web front-end on the
SVN repo. What I have come across is using Apache+Nginx with Nginx in
a proxy configuration. I would prefer to have a purely Nginx web
server.

Does anyone have a recommendation for a Nginx web front-end?

Thanks in advance.


Re: Migrate from Git to SVN on Fedora server

2024-05-21 Thread Daniel Sahlberg
Den tis 21 maj 2024 kl 12:55 skrev Jeffrey Walton :

> Hi Everyone,
>
> I'd like to migrate some source code from Git to SVN on my Fedora
> server. The rub is, I'd like to use Nginx instead of Apache.
>

Hi,

Welcome!

Be aware of a difference between Git and Subversion:
In Git, there is only a "repository" (which contains both the history in
the .git directory and all source files).
In Subversion, the "repository" is a specific directory (containing the
history for each file) and then you checkout a "working copy" where you
have the actual source files.


>
> I think I can switch the repo from Git to SVN by performing the
> following at the server:
>
> cd /var/test-src
> find . -name '.git' -exec rm -rf {} \;
> svnadmin create /var/test-src
>

That will only perform part of the job.

First of all you only seem to remove ALL Git repositories but you only
create ONE repository. You should probably create one repository for each
Git repository you had, the repository should be somewhere ELSE than the
directory where you store your source files (/var/repositories/[repository
name]).

Second you need to add the source files from the directory where you had
your Git repository. Easiest is probably to run svn import.

You would probably have to create a small bash script to call in the find
which performs both rm -rf, svnadmin create and svn import.

Last word of caution: when you delete the .git directory you will also
delete all history. Depending on your usecase that might be what you want.



>
> That should stand up the SVN server on the existing source code (that
> was formerly under Git). Also see
> .
>
> What I am less sure about is, how to put a Nginx web front-end on the
> SVN repo. What I have come across is using Apache+Nginx with Nginx in
> a proxy configuration. I would prefer to have a purely Nginx web
> server.
>
> Does anyone have a recommendation for a Nginx web front-end?
>

If you want to access Subversion over HTTP/HTTPS, you need to run Apache
Httpd. If you want to use Nginx in front of Httpd, you can probably find
useful information about how to setup a reverse proxy in front of Httpd.
See https://subversion.apache.org/faq.html#reverseproxy

There are also other options to access the repository, see the Subversion
book: https://svnbook.red-bean.com/en/1.7/svn.serverconfig.choosing.html

Kind regards,
Daniel


Re: Migrate from Git to SVN on Fedora server

2024-05-21 Thread Nathan Hartman
On Tue, May 21, 2024 at 6:55 AM Jeffrey Walton  wrote:

> Hi Everyone,
>
> I'd like to migrate some source code from Git to SVN on my Fedora
> server. The rub is, I'd like to use Nginx instead of Apache.
>
> I think I can switch the repo from Git to SVN by performing the
> following at the server:
>
> cd /var/test-src
> find . -name '.git' -exec rm -rf {} \;
> svnadmin create /var/test-src
>
> That should stand up the SVN server on the existing source code (that
> was formerly under Git). Also see
> .
>
> What I am less sure about is, how to put a Nginx web front-end on the
> SVN repo. What I have come across is using Apache+Nginx with Nginx in
> a proxy configuration. I would prefer to have a purely Nginx web
> server.
>
> Does anyone have a recommendation for a Nginx web front-end?
>
> Thanks in advance.
>

Hi Jeffrey,

The reason why you can find setups that use Apache-only or Apache+Nginx,
but not Nginx alone, is because access to Subversion repositories through
Apache requires use of an Apache module (mod_dav_svn). Currently there
isn't such a module for Nginx.

Hope this helps,
Nathan


Re: Migrate from Git to SVN on Fedora server

2024-05-21 Thread Nico Kadel-Garcia
On Tue, May 21, 2024 at 6:55 AM Jeffrey Walton  wrote:
>
> Hi Everyone,
>
> I'd like to migrate some source code from Git to SVN on my Fedora
> server. The rub is, I'd like to use Nginx instead of Apache.

Why? What do you expect to get from Nginx that is not built into
Subversion's httpd integration?


Re: Migrate from Git to SVN on Fedora server

2024-05-21 Thread Jeffrey Walton
On Tue, May 21, 2024 at 6:28 PM Nico Kadel-Garcia  wrote:
>
> On Tue, May 21, 2024 at 6:55 AM Jeffrey Walton  wrote:
> >
> > I'd like to migrate some source code from Git to SVN on my Fedora
> > server. The rub is, I'd like to use Nginx instead of Apache.
>
> Why? What do you expect to get from Nginx that is not built into
> Subversion's httpd integration?

Nginx is more efficient and appears to be more secure than Apache.
Plus, nginx is already running on this box.

Jeff


`svnadmin create` on an existing set of source files

2024-05-21 Thread Jeffrey Walton
Hi Everyone,

I have my source files in /var/test-svn. The test-svn directory has
*.h and *.c files. I am trying to create a repo from them.

As root, I perform the following:

# cd /var
# svnadmin create --fs-type fsfs test-svn
svnadmin: E200011: Repository creation failed
svnadmin: E200011: Could not create top-level directory
svnadmin: E200011: 'test-svn' exists and is non-empty

I think I am missing something from my reading, like at

and .
My apologies for my rusty knowledge of subversion. I've been stuck in
the git world for far too long.

So the question is, how do I create a repo from an existing set of
project files?

Jeff


Re: `svnadmin create` on an existing set of source files

2024-05-21 Thread Daniel Sahlberg
ons 22 maj 2024 kl. 05:28 skrev Jeffrey Walton :

> Hi Everyone,
>
> I have my source files in /var/test-svn. The test-svn directory has
> *.h and *.c files. I am trying to create a repo from them.
>
> As root, I perform the following:
>
> # cd /var
> # svnadmin create --fs-type fsfs test-svn
> svnadmin: E200011: Repository creation failed
> svnadmin: E200011: Could not create top-level directory
> svnadmin: E200011: 'test-svn' exists and is non-empty
>
> I think I am missing something from my reading, like at
> <
> https://svnbook.red-bean.com/en/1.7/svn.ref.svnadmin.html#svn.ref.svnadmin.c
> >
> and .
> My apologies for my rusty knowledge of subversion. I've been stuck in
> the git world for far too long.
>
> So the question is, how do I create a repo from an existing set of
> project files?
>
> Jeff



Be aware of a difference between Git and Subversion:
In Git, there is only a "repository" (which contains both the history in
the .git directory and all source files).
In Subversion, the "repository" is a specific directory (containing the
history for each file) and then you checkout a separate directory "working
copy" where you have the actual source files.

So you need to do

cd /var
svnadmin create test-repo
svn import test-svn file:///var/test-repo

You can the check out a new working copy

svn co file:///var/repo wc

Hope this helps!

Kind regards
Daniel Sahlberg