ARTICLE - Developer Tools

Upgrading SVN to 1.8 on CentOS 7

The SVN version bundled with CentOS 7 is often old. You can upgrade SVN to 1.8 by configuring the Wandisco yum repository. This article covers removing the old version, configuring the repo, installing, and verifying.

2023-04-02 cnblogs.com (CQZHUOMI)

Upgrading SVN to 1.8 on CentOS 7

The SVN version bundled with CentOS 7 is often old (typically 1.7.x). It is fine in most cases, but you will want to upgrade when your team needs syntax features that only 1.8 supports, an older version carries a known security issue, or you need consistent SVN behavior across multiple machines. In that situation you can upgrade SVN to 1.8 by configuring the yum repository provided by Wandisco.

Check your current version first with svn --version --quiet. Compared with 1.7, 1.8 adds options like --parents and better merge tracking — but for legacy projects an upgrade is not mandatory, so assess the need before starting.

First compare the two major versions to decide whether the upgrade is really necessary:

Feature SVN 1.7 SVN 1.8
Working copy format Single .svn directory Compatible with 1.7, new metadata features
--parents option Not supported Supported
Merge tracking Basic Greatly improved; svn merge --reintegrate more reliable
Proxy / auth Older Newer, handles more environments

If the team only uses SVN for documents and simple code, 1.7 is more than enough. The real drivers to upgrade are: needing 1.8-only commands or behavior, a security issue in the old version, or standardizing versions across machines. Conversely, if there is no hard requirement, staying on the bundled 1.7 is actually safer — the Wandisco repo itself has been unmaintained for years, and the risk you take on for the upgrade may outweigh the old version's problems.

1. Remove the Old SVN

yum remove subversion

Remove the old SVN bundled with the system first.

2. Configure the SVN 1.8 Repository

vi /etc/yum.repos.d/wandisco-svn.repo

Enter the following content:

[WandiscoSVN]
name=Wandisco SVN Repo
baseurl=http://opensource.wandisco.com/centos/7/svn-1.8/RPMS/$basearch/
enabled=1
gpgcheck=0

3. Install

yum clean all && yum install subversion -y

4. Verify the Installation

svn --version

The output should show version 1.8:

svn, version 1.8.16 (r1740329)
   compiled Apr 26 2016, 13:16:01 on x86_64-unknown-linux-gnu

Also run svnadmin --version to confirm the server-side tool upgraded too — if the client and server tool versions differ, the repository format can become incompatible. You can also verify the repository is accessible:

svnadmin verify /var/svn/repos
svnlook youngest /var/svn/repos

If the revision number from svnlook youngest matches the pre-upgrade value, the repository data is intact.

Back Up the Repository First

Upgrading a repository is not like upgrading ordinary software: if svnadmin becomes incompatible with the repository format, an old repository may no longer open directly. The safe approach is a full dump first:

svnadmin dump /var/svn/repos > repos_backup.dump

If something goes wrong, restore with the old svnadmin load without losing any commit history.

One-Shot Script

Combine the entire upgrade into a single command:

yum remove subversion
sudo tee /etc/yum.repos.d/wandisco-svn.repo <<-'EOF'
[WandiscoSVN]
name=Wandisco SVN Repo
baseurl=http://opensource.wandisco.com/centos/7/svn-1.8/RPMS/$basearch/
enabled=1
gpgcheck=0
EOF
yum clean all && yum install subversion -y && svn --version

A full post-upgrade check

After the upgrade, run a self-check in this order so problems surface now rather than for users:

  1. svn --version confirms the client is 1.8;
  2. svnadmin --version confirms the server tool matches;
  3. svnlook youngest /var/svn/repos matches the pre-upgrade max revision;
  4. svn checkout a working copy, edit a file, and commit to exercise the full read/write path;
  5. Confirm existing auth configs (such as authz and passwd) still apply.

Notes

  1. Back up the SVN repository before upgrading (svnadmin dump) to avoid data corruption from compatibility issues;
  2. The Wandisco repository has been unmaintained for years; only use it when compatibility with an old environment is required. For a fresh setup, prefer the system-bundled version or migrate to Git;
  3. gpgcheck=0 disables GPG verification. For higher security, provide the official GPG key and set gpgcheck=1;
  4. If svnadmin becomes incompatible with the repository format after upgrade, dump with the old svnadmin dump first, then import.

Common post-upgrade issues

Symptom Fix
Format errors like svn: E155021 Dump with the old svnadmin dump, then rebuild with the new svnadmin load
svnadmin still old Confirm the yum repo is active, run yum clean all, and reinstall
Clients cannot connect Check whether svnserve or the Apache module was restarted/reinstalled with the upgrade
Auth broken Confirm authz, passwd and other config file paths and permissions are unchanged

Most of these surface during the full post-upgrade self-check, so don't skip that step.

Migrating to Git as an Alternative

If the team's repository has no heavy legacy baggage, consider migrating to Git directly: git svn clone imports the full SVN history into a Git repository, unlocking more mature branching and PR workflows plus a richer tool ecosystem.

The migration itself is not complex: first run git svn clone https://svn.example.com/repos -s myrepo locally to clone the full history, verify the commit log is complete, then push to a private GitHub or GitLab repository and tell the team to switch their workflow. Make sure everyone commits and syncs local changes before migrating to avoid a fork in history. For long-lived projects this is the more worthwhile direction; if you only need to solve a compatibility issue temporarily, there's no need to change systems over it.

SVN is one of the common version control systems. For more version control and team collaboration content, see the developer tools category, such as SVN local global ignore settings and Git workflow for website development. Whether you upgrade to 1.8 or migrate to Git, backing up first and verifying step by step are principles that never go wrong.

Reference: Subversion official docs https://subversion.apache.org/docs/

Original post: https://www.cnblogs.com/cqzhuomi/articles/17280906.html (cnblogs.com CQZHUOMI, repost)

Integration & Code Examples

Example 1: Back up and verify the repository before upgrading

# 1) Record the current version and the youngest revision
svn --version --quiet
svnlook youngest /var/svn/repos

# 2) Full dump including history, then compress it for archiving
mkdir -p /data/backup
svnadmin dump /var/svn/repos > /data/backup/repos.dump
gzip -9 /data/backup/repos.dump
ls -lh /data/backup/repos.dump.gz

# 3) Verify integrity; the last "Verified revision" line means success
svnadmin verify /var/svn/repos | tail -3

# 4) Note the repository format in case a rollback decision is needed
head -3 /var/svn/repos/format
svnadmin info /var/svn/repos

svnadmin dump is a logical backup and the most reliable way to restore across versions; copying the repository directory may not open under a different format.

Example 2: Configure the 1.8 repo and confirm client and admin versions match

# 1) Remove the old package first, or yum may think it is already satisfied
yum remove -y subversion

# 2) Add the Wandisco 1.8 repository
cat > /etc/yum.repos.d/wandisco-svn.repo <<'EOF'
[WandiscoSVN]
name=Wandisco SVN Repo
baseurl=http://opensource.wandisco.com/centos/7/svn-1.8/RPMS/$basearch/
enabled=1
gpgcheck=0
EOF

# 3) Clear caches, install and check versions
yum clean all
yum install -y subversion
svn --version --quiet
svnadmin --version --quiet

Client and svnadmin must be the same version, otherwise you can hit Expected FS format style errors; after upgrading, run svn info inside a few working copies as a spot check.

Four Versions to Record Before and After the Upgrade

Four separate version numbers matter here, and each one has its own command and its own failure signature.

Object Query Value in this article What a mismatch looks like
Client svn svn --version --quiet 1.8.16 (r1740329) after the upgrade Working copies in the old format are rejected
Server svnadmin svnadmin --version Same version as the client Expected FS format errors
Repository format head -3 /var/svn/repos/format, svnadmin info Written down before the upgrade svn: E155021
Latest revision svnlook youngest /var/svn/repos Unchanged after the upgrade Commits missing from the history

The third row is the one people skip. format on the first line holds the number the running svnadmin must be able to open, so recording it before the upgrade is what tells you afterwards whether a rollback is even possible.

The fourth row is the fastest integrity check available: svnlook youngest after the upgrade should return the same revision number as before, which proves the history survived without a full checkout.

What Each Line of the Wandisco Repo File Does

The repo file has four effective settings, and each changes a different part of the outcome.

baseurl is what pins the version: .../centos/7/svn-1.8/RPMS/$basearch/ selects the 1.8 branch and expands to the host architecture, so a different path means a different SVN version, not a faster mirror.

enabled=1 makes the repo eligible, but yum clean all is still needed because the previous package list is cached; skipping it is why a reinstall can land on the old version again.

gpgcheck=0 turns off package signature verification for this repo. That is a deliberate trade for an unmaintained source; where the policy requires it, supplying the key and setting gpgcheck=1 restores the check.

Limitations

  • Figures reflect public information at publication; terms, prices and quotas follow the provider's current published terms.
  • This article reflects public information as of 2023-04-02; terms, prices and quotas follow the provider's current published terms.
  • Third-party capability and limit statements follow their official documentation; no further commitment is implied here.

FAQ

Is the 1.8 upgrade worth it for most teams?

Only upgrade when you need a 1.8-only command; teams that just store documents are safer on 1.7. Real drivers are options like --parents, the improved merge tracking behind svn merge --reintegrate, or known security fixes. The Wandisco repo has been unmaintained for years, so the upgrade risk can exceed the old version's problems.

What should be backed up before the SVN upgrade?

Use svnadmin dump for the whole repository — copying the directory is not a backup. A dump is logical, so it restores cleanly across versions, while a raw directory copy may not open when formats differ. Record svnlook youngest before the 1.8 upgrade and compare the revision number afterwards.

Why does E155021 appear after the upgrade?

Typically E155021 means the repository format is incompatible, so dump with the old svnadmin and load with the new one. Check the format version via svnadmin info first and confirm the 1.8 binary can open it; a client and svnadmin on different versions also throw Expected FS format, so align both before digging further.

When should you migrate to Git instead of upgrading?

Typically migrate when the repo carries little history and the team will adopt Git workflows anyway. git svn clone imports the full history; verify the commit log, push to a private GitLab repo, then announce the switch. If you only need one compatibility fix, replacing the system costs more than it saves; have everyone commit first.

Related Providers

  • Apache Subversion: Use it when checking which command options changed between 1.7 and 1.8.
  • Alibaba Cloud ECS: Use it when a spare CentOS 7 host is needed to replay the yum source upgrade.
  • Tencent Cloud CVM: Use it when several SVN servers must end up on the same minor version.

Community & Resources

Official docs and communities

Learning resources and tools

Original source: cnblogs.com (CQZHUOMI) ↗