# SVN Server

# Export SVN repository

At first it seems quite forward to do this, but I have ran into the issue of encoding problems. And trying to get a huge (40G) dumpfile into the container.

##### **What did work for me:**

1\. Have a bind path in your container, to manage the large file

[![image.png](https://wiki.sophior.com/uploads/images/gallery/2024-10/scaled-1680-/RKaimage.png)](https://wiki.sophior.com/uploads/images/gallery/2024-10/RKaimage.png)

2\. Use the container and dump the file into this path

```
svnrdump  dump -r0:HEAD [URL_TO_YOUR_REPO] > Your_dumpfile.dmp
```

This will show the progress as follows:

[![image.png](https://wiki.sophior.com/uploads/images/gallery/2024-10/scaled-1680-/MK0image.png)](https://wiki.sophior.com/uploads/images/gallery/2024-10/MK0image.png)

svnadmin load /path/yourrepo &lt; /path/your/dum.dmp

[![image.png](https://wiki.sophior.com/uploads/images/gallery/2024-10/scaled-1680-/oOAimage.png)](https://wiki.sophior.com/uploads/images/gallery/2024-10/oOAimage.png)

#####   
**What didn't work for me:**

This is the official documentation : [dump your SVN ](https://svnbook.red-bean.com/en/1.7/svn.ref.svnadmin.c.dump.html)

```
svnadmin dump /path/to/your/old/repo > backup.dump
svnadmin load /path/to/your/new/repo < backup.dump.dmp
```

If you redirect the input to your host, it circumvents the large file in the docker.

```
cd /tmp
docker exec -it edf77623c9207 svnadmin dump /home/svn/YourRepository > YourRepository_svn.dmp
```

But importing it back, an error is produced:

```
' into a number04: Could not convert ' 2
```

# Migrate configuration after export

After you have the repository in a dmp file, you don't have your configuration yet.  
  
In my case with the docker, I can see which configuration files are required:

*docker run -d --name svn-server -p 80:80 -p 3690:3690 -v &lt;hostpath&gt;:**/home/svn** -v svn\_config:/**etc/subversion** -v svnadmin\_config:**/opt/svnadmin/data** elleflorio/svn-server*

In reality, I need to copy the following files over (and use my mapped drive to transfer these files before restarting the container)

```bash
    
/opt/svnadmin/data # cp /var/svnbackup/svnadmin/config.ini config.ini
/opt/svnadmin/data # cp /var/svnbackup/svnadmin/config.ini config.tpl.ini
/opt/svnadmin/data # cp /var/svnbackup/svnadmin/config.tpl.ini config.tpl.ini
/opt/svnadmin/data # cp /var/svnbackup/svnadmin/userroleassignments.ini userroleassignments.ini


/var/svnbackup # cp ./subversion/passwd /etc/subversion/passwd
/var/svnbackup # cp ./subversion/subversion-access-control /etc/subversion/subve

/home/svn/YourRepo/conf # cp /var/svnbackup/conf/hooks-env.tmpl hooks-env.tmpl
/home/svn/YourRepo/conf # cp /var/svnbackup/conf/passwd passwd
/home/svn/YourRepo/conf # cp /var/svnbackup/conf/authz authz
/home/svn/YourRepo/conf # cp /var/svnbackup/conf/svnserve.conf svnserve.conf


```

In windows, to switch the clients, you can use your hosts file. So your existing projects just keep working as they always have. (provided you've used the same URL before with another IP)

[![image.png](https://wiki.sophior.com/uploads/images/gallery/2024-10/scaled-1680-/89Ximage.png)](https://wiki.sophior.com/uploads/images/gallery/2024-10/89Ximage.png)