Migration leads to no repositories without error

Hi,

I copied configuration and repositories from an old server, running 1.60 to a new one, running 2.46.1. When I start the server, I am asked how to migrate the repository. I chose inline, the migration starts and it says that it is restarting. After that I am relocated to the repositories page but this is empty, so no repositories available.
In the log I cannot see anything which would say that there was an error.
How can I get the repositories to work?

The only difference is, that on the old server, the repos were located at /var/lib/scm/repositories and now this dir is a symlink to /data/repositories. Might that be the reason? I am on an Ubuntu 22.04.3 LTS.

Thanks!

Hi @brainbugfix ,

thanks for updating! The link should be of no concern as long as the resulting path is accessible for the linux user running SCM-Manager. Have I understood you correctly, that all repositories were listed correctly on the migration page? If this is the case, you should check the file repository-paths.xml in the resulting SCM-Managre home directory. In this, you should find one XML entry for each repository with a path to the repository data. In these paths you sould find a metadata.xml with the metadata of the corresponding repository and some further paths, including a directory named data containing the native repository files. Please mind, that the migration itself might take some time and that it starts after submitting the migration form when the server starts up once more. You should find log entries saying moving repository data from x to y for each migrated repository. You could also check the file config/executedUpdates.xml for an entry with the key sonia.scm.repository.xml. If this is missing, the update did not take place and we would have to check, why not.

If this does not help, maybe you could send us the logs from your startup.

Regards
René

Hi René,

here is the log file starting before the migration starts:

2023-09-11 17:45:42.806 [main] [          ] INFO  sonia.scm.lifecycle.classloading.ClassLoaderLifeCycle - create new simple ClassLoaderLifeCycle
2023-09-11 17:45:42.809 [main] [          ] INFO  sonia.scm.lifecycle.BootstrapContextFilter - register for restart events
2023-09-11 17:45:42.810 [main] [          ] INFO  sonia.scm.event.LegmanScmEventBus - create new event bus ScmEventBus-1
2023-09-11 17:45:42.847 [main] [          ] WARN  io.micrometer.core.instrument.binder.jvm.ExecutorServiceMetrics - Failed to bind as org.apache.shiro.concurrent.SubjectAwareExecutorService is unsupported.
2023-09-11 17:45:42.848 [main] [          ] INFO  sonia.scm.event.ScmEventBus - use sonia.scm.event.LegmanScmEventBus as event bus implementation
2023-09-11 17:45:42.873 [main] [          ] INFO  sonia.scm.lifecycle.BootstrapContextListener - start scm-manager initialization
2023-09-11 17:45:43.242 [main] [          ] INFO  sonia.scm.plugin.PluginProcessor - collect plugins
2023-09-11 17:45:43.260 [main] [          ] INFO  sonia.scm.plugin.PluginProcessor - install plugin tree:
+- scm-git-plugin@2.46.1
+- scm-legacy-plugin@2.46.1
+- scm-hg-plugin@2.46.1
+- scm-svn-plugin@2.46.1

2023-09-11 17:45:43.710 [main] [          ] INFO  sonia.scm.update.MigrationWizardModule - ==========================================================
2023-09-11 17:45:43.710 [main] [          ] INFO  sonia.scm.update.MigrationWizardModule - =                                                        =
2023-09-11 17:45:43.710 [main] [          ] INFO  sonia.scm.update.MigrationWizardModule - =             STARTING MIGRATION SERVLET                 =
2023-09-11 17:45:43.710 [main] [          ] INFO  sonia.scm.update.MigrationWizardModule - =                                                        =
2023-09-11 17:45:43.710 [main] [          ] INFO  sonia.scm.update.MigrationWizardModule - =   Open SCM-Manager in a browser to start the wizard.   =
2023-09-11 17:45:43.710 [main] [          ] INFO  sonia.scm.update.MigrationWizardModule - =                                                        =
2023-09-11 17:45:43.710 [main] [          ] INFO  sonia.scm.update.MigrationWizardModule - ==========================================================
2023-09-11 18:01:11.229 [ScmEventBus-1-0] [          ] WARN  sonia.scm.lifecycle.BootstrapContextFilter - received restart event from class sonia.scm.update.MigrationWizardServlet with reason: wrote migration data
2023-09-11 18:01:11.229 [ScmEventBus-1-0] [          ] WARN  sonia.scm.lifecycle.RestartStrategy - destroy injection context
2023-09-11 18:01:11.229 [ScmEventBus-1-0] [          ] INFO  sonia.scm.lifecycle.BootstrapContextListener - shutdown scm-manager context
2023-09-11 18:01:11.230 [ScmEventBus-1-0] [          ] INFO  sonia.scm.lifecycle.ServletContextCleaner - remove cached attributes from context
2023-09-11 18:01:11.230 [ScmEventBus-1-0] [          ] INFO  sonia.scm.lifecycle.ServletContextCleaner - keep attribute com.google.inject.Injector in servlet context
2023-09-11 18:01:11.230 [ScmEventBus-1-0] [          ] INFO  sonia.scm.lifecycle.ServletContextCleaner - keep attribute javax.servlet.context.tempdir in servlet context
2023-09-11 18:01:11.230 [ScmEventBus-1-0] [          ] INFO  sonia.scm.lifecycle.ServletContextCleaner - keep attribute org.eclipse.jetty.util.DecoratedObjectFactory in servlet context
2023-09-11 18:01:11.230 [ScmEventBus-1-0] [          ] INFO  sonia.scm.lifecycle.ServletContextCleaner - keep attribute resourceCache in servlet context
2023-09-11 18:01:11.230 [ScmEventBus-1-0] [          ] INFO  sonia.scm.lifecycle.ServletContextCleaner - keep attribute org.eclipse.jetty.tmpdirConfigured in servlet context
2023-09-11 18:01:11.230 [ScmEventBus-1-0] [          ] INFO  sonia.scm.lifecycle.ServletContextCleaner - keep attribute org.eclipse.jetty.server.Executor in servlet context
2023-09-11 18:01:11.231 [ScmEventBus-1-0] [          ] INFO  sonia.scm.lifecycle.classloading.ClassLoaderLifeCycle - shutdown classloader infrastructure
2023-09-11 18:01:11.232 [ScmEventBus-1-0] [          ] WARN  sonia.scm.lifecycle.PosixRestartStrategy - restart scm-manager jvm process
2023-09-11 18:01:13.412 [main] [          ] INFO  sonia.scm.lifecycle.classloading.ClassLoaderLifeCycle - create new simple ClassLoaderLifeCycle
2023-09-11 18:01:13.415 [main] [          ] INFO  sonia.scm.lifecycle.BootstrapContextFilter - register for restart events
2023-09-11 18:01:13.416 [main] [          ] INFO  sonia.scm.event.LegmanScmEventBus - create new event bus ScmEventBus-1
2023-09-11 18:01:13.452 [main] [          ] WARN  io.micrometer.core.instrument.binder.jvm.ExecutorServiceMetrics - Failed to bind as org.apache.shiro.concurrent.SubjectAwareExecutorService is unsupported.
2023-09-11 18:01:13.453 [main] [          ] INFO  sonia.scm.event.ScmEventBus - use sonia.scm.event.LegmanScmEventBus as event bus implementation
2023-09-11 18:01:13.479 [main] [          ] INFO  sonia.scm.lifecycle.BootstrapContextListener - start scm-manager initialization
2023-09-11 18:01:14.061 [main] [          ] INFO  sonia.scm.plugin.PluginProcessor - collect plugins
2023-09-11 18:01:14.092 [main] [          ] INFO  sonia.scm.plugin.PluginProcessor - install plugin tree:
+- scm-git-plugin@2.46.1
+- scm-legacy-plugin@2.46.1
+- scm-hg-plugin@2.46.1
+- scm-svn-plugin@2.46.1

2023-09-11 18:01:15.266 [main] [          ] INFO  sonia.scm.lifecycle.modules.ApplicationModuleProvider - add module class sonia.scm.repository.hooks.HookModule
2023-09-11 18:01:15.266 [main] [          ] INFO  sonia.scm.lifecycle.modules.ApplicationModuleProvider - add module class sonia.scm.web.GitServletModule
2023-09-11 18:01:15.267 [main] [          ] INFO  sonia.scm.lifecycle.modules.ApplicationModuleProvider - add module class sonia.scm.autoconfig.AutoConfigModule
2023-09-11 18:01:15.267 [main] [          ] INFO  sonia.scm.lifecycle.modules.ApplicationModuleProvider - add module class sonia.scm.web.HgServletModule
2023-09-11 18:01:15.267 [main] [          ] INFO  sonia.scm.lifecycle.modules.ApplicationModuleProvider - add module class sonia.scm.security.gpg.GPGModule
2023-09-11 18:01:15.267 [main] [          ] INFO  sonia.scm.lifecycle.modules.ApplicationModuleProvider - add module class sonia.scm.web.SvnServletModule
2023-09-11 18:01:15.267 [main] [          ] INFO  sonia.scm.lifecycle.modules.ApplicationModuleProvider - add module class sonia.scm.legacy.LegacyModule
2023-09-11 18:01:15.306 [main] [          ] INFO  sonia.scm.filter.WebElementModule - bind filter class sonia.scm.metrics.HttpMetricsFilter to filter chain
2023-09-11 18:01:15.307 [main] [          ] INFO  sonia.scm.filter.WebElementModule - bind filter class sonia.scm.filter.BaseUrlFilter to filter chain
2023-09-11 18:01:15.307 [main] [          ] INFO  sonia.scm.filter.WebElementModule - bind filter class sonia.scm.security.TokenExpiredFilter to filter chain
2023-09-11 18:01:15.307 [main] [          ] INFO  sonia.scm.filter.WebElementModule - bind filter class sonia.scm.web.security.ApiAuthenticationFilter to filter chain
2023-09-11 18:01:15.314 [main] [          ] INFO  sonia.scm.filter.WebElementModule - bind filter class sonia.scm.legacy.LegacyProtocolServletAuthenticationFilter to filter chain
2023-09-11 18:01:15.315 [main] [          ] INFO  sonia.scm.filter.WebElementModule - bind filter class sonia.scm.web.filter.DefaultHttpProtocolServletAuthenticationFilter to filter chain
2023-09-11 18:01:15.315 [main] [          ] INFO  sonia.scm.filter.WebElementModule - bind filter class sonia.scm.filter.MDCFilter to filter chain
2023-09-11 18:01:15.315 [main] [          ] INFO  sonia.scm.filter.WebElementModule - bind filter class sonia.scm.web.security.TokenRefreshFilter to filter chain
2023-09-11 18:01:15.315 [main] [          ] INFO  sonia.scm.filter.WebElementModule - bind filter class sonia.scm.filter.SecurityHeadersFilter to filter chain
2023-09-11 18:01:15.315 [main] [          ] INFO  sonia.scm.filter.WebElementModule - bind servlet class sonia.scm.lifecycle.RestartServlet to servlet chain
2023-09-11 18:01:15.315 [main] [          ] INFO  sonia.scm.filter.WebElementModule - bind servlet class sonia.scm.web.i18n.I18nServlet to servlet chain
2023-09-11 18:01:15.316 [main] [          ] INFO  sonia.scm.filter.WebElementModule - bind servlet class sonia.scm.web.protocol.HttpProtocolServlet to servlet chain
2023-09-11 18:01:15.316 [main] [          ] INFO  sonia.scm.filter.WebElementModule - bind servlet class sonia.scm.WebResourceServlet to servlet chain
2023-09-11 18:01:15.354 [main] [          ] INFO  sonia.scm.plugin.DefaultExtensionProcessor - start processing extensions
2023-09-11 18:01:15.373 [main] [          ] WARN  sonia.scm.plugin.ExtensionBinder - could not find extension for extension point interface sonia.scm.api.v2.resources.LogoutRedirection
2023-09-11 18:01:15.388 [main] [          ] WARN  sonia.scm.plugin.ExtensionBinder - could not find extension for extension point interface sonia.scm.io.FileSystem
2023-09-11 18:01:15.451 [main] [          ] INFO  sonia.scm.plugin.DefaultExtensionProcessor - bound extensions in 97.36 ms
2023-09-11 18:01:15.588 [main] [          ] INFO  sonia.scm.lifecycle.modules.ScmSecurityModule - bind security realm class sonia.scm.security.BearerRealm
2023-09-11 18:01:15.589 [main] [          ] INFO  sonia.scm.lifecycle.modules.ScmSecurityModule - bind security realm class sonia.scm.initialization.InitializationRealm
2023-09-11 18:01:15.589 [main] [          ] INFO  sonia.scm.lifecycle.modules.ScmSecurityModule - bind security realm class sonia.scm.web.security.AdministrationContextRealm
2023-09-11 18:01:15.589 [main] [          ] INFO  sonia.scm.lifecycle.modules.ScmSecurityModule - bind security realm class sonia.scm.security.DefaultRealm
2023-09-11 18:01:15.589 [main] [          ] INFO  sonia.scm.lifecycle.modules.ScmSecurityModule - bind security realm class sonia.scm.security.AnonymousRealm
2023-09-11 18:01:15.589 [main] [          ] INFO  sonia.scm.lifecycle.modules.ScmSecurityModule - bind security realm class sonia.scm.legacy.LegacyRealm
2023-09-11 18:01:15.589 [main] [          ] INFO  sonia.scm.lifecycle.modules.ScmSecurityModule - bind security realm class sonia.scm.security.ApiKeyRealm
2023-09-11 18:01:16.837 [main] [          ] WARN  sonia.scm.cache.GuavaCacheConfigurationReader - could not find manual configuration at /var/lib/scm/ext/gcache.xml
2023-09-11 18:01:17.006 [main] [          ] INFO  sonia.scm.repository.DefaultRepositoryManager - added RepositoryHandler class sonia.scm.repository.HgRepositoryHandler for type Type{name=hg, displayName=Mercurial}
2023-09-11 18:01:17.108 [main] [          ] INFO  sonia.scm.repository.DefaultRepositoryManager - added RepositoryHandler class sonia.scm.repository.SvnRepositoryHandler for type Type{name=svn, displayName=Subversion}
2023-09-11 18:01:17.108 [main] [          ] INFO  sonia.scm.repository.DefaultRepositoryManager - added RepositoryHandler class sonia.scm.repository.GitRepositoryHandler for type Type{name=git, displayName=Git}
2023-09-11 18:01:17.281 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.repository.RemoveDeletedRepositoryRole
2023-09-11 18:01:17.281 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.update.RepositoryUpdateAfterCreationHook
2023-09-11 18:01:17.281 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.repository.EventDrivenRepositoryArchiveCheckInitializer
2023-09-11 18:01:17.281 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.user.DefaultUserManager
2023-09-11 18:01:17.281 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.api.v2.resources.GitRepositoryConfigChangeClearRepositoryCacheListener
2023-09-11 18:01:17.281 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.plugin.PluginCenterRefresh
2023-09-11 18:01:17.281 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.security.AuthorizationChangedEventProducer
2023-09-11 18:01:17.282 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.config.ScmConfigurationChangedListener
2023-09-11 18:01:17.282 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.repository.GitRepositoryModifyListener
2023-09-11 18:01:17.282 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.repository.LastModifiedUpdateListener
2023-09-11 18:01:17.282 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.repository.GitRepositoryConfigInitializer
2023-09-11 18:01:17.282 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.repository.DefaultBranchDeleteProtection
2023-09-11 18:01:17.282 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.repository.DefaultBranchChangedDispatcher
2023-09-11 18:01:17.282 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.repository.DefaultRepositoryRoleManager
2023-09-11 18:01:17.282 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.repository.ReadOnlyCheckInitializer
2023-09-11 18:01:17.282 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.repository.spi.FileLockPreCommitHook
2023-09-11 18:01:17.282 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.initialization.DefaultInitializationFinisher
2023-09-11 18:01:17.300 [main] [          ] INFO  sonia.scm.lifecycle.modules.EagerSingletonModule - initialize eager singleton sonia.scm.user.AnonymousUserDeletionEventHandler
2023-09-11 18:01:17.412 [main] [          ] INFO  sonia.scm.repository.work.WorkdirProvider - deleting 0 old work dirs in /tmp/scm-work
2023-09-11 18:01:17.418 [main] [          ] INFO  sonia.scm.group.DefaultGroupManager - create group _authenticated of type xml
2023-09-11 18:01:17.491 [ScmEventBus-1-2] [          ] INFO  sonia.scm.security.DefaultAuthorizationCollector - invalidate cache, because of a received authorization event
2023-09-11 18:01:17.797 [qtp124313277-18] [          ] INFO  sonia.scm.lifecycle.modules.ResteasyAllInOneServletDispatcher - init resteasy
2023-09-11 18:01:18.479 [qtp124313277-18] [          ] WARN  sonia.scm.security.DefaultAccessTokenCookieIssuer - issuet a non secure cookie, protect your scm-manager instance with tls https://scm-manager.org/docs/latest/en/administration/scm-server/
2023-09-11 18:01:40.202 [qtp124313277-13] [3nTpZ5XteN] WARN  sonia.scm.security.DefaultAccessTokenCookieIssuer - issuet a non secure cookie, protect your scm-manager instance with tls https://scm-manager.org/docs/latest/en/administration/scm-server/

This is the executedUpdates.xml:

<?xml version="1.0" ?>
<configuration type="config-entry">
  <entry>
    <key>sonia.scm.plugin-center.authentication</key>
    <value>
      <latestVersion>2.30.0</latestVersion>
    </value>
  </entry>
  <entry>
    <key>sonia.scm.plugin.svn</key>
    <value>
      <latestVersion>2.0.0</latestVersion>
    </value>
  </entry>
  <entry>
    <key>sonia.scm.dao.xml</key>
    <value>
      <latestVersion>2.0.0</latestVersion>
    </value>
  </entry>
  <entry>
    <key>sonia.scm.user.xml</key>
    <value>
      <latestVersion>2.0.0</latestVersion>
    </value>
  </entry>
  <entry>
    <key>sonia.scm.plugin.git</key>
    <value>
      <latestVersion>2.0.0</latestVersion>
    </value>
  </entry>
  <entry>
    <key>sonia.scm.git.lfs</key>
    <value>
      <latestVersion>2.0.1</latestVersion>
    </value>
  </entry>
  <entry>
    <key>sonia.scm.security.xml</key>
    <value>
      <latestVersion>2.0.1</latestVersion>
    </value>
  </entry>
  <entry>
    <key>sonia.scm.repository.xml</key>
    <value>
      <latestVersion>2.0.3</latestVersion>
    </value>
  </entry>
  <entry>
    <key>sonia.scm.plugin-center</key>
    <value>
      <latestVersion>2.0.1</latestVersion>
    </value>
  </entry>
  <entry>
    <key>sonia.scm.index</key>
    <value>
      <latestVersion>2.0.0</latestVersion>
    </value>
  </entry>
  <entry>
    <key>config.xml</key>
    <value>
      <latestVersion>2.4.0</latestVersion>
    </value>
  </entry>
  <entry>
    <key>sonia.scm.group.xml</key>
    <value>
      <latestVersion>2.0.0</latestVersion>
    </value>
  </entry>
  <entry>
    <key>sonia.scm.plugin.PluginSetsConfig</key>
    <value>
      <latestVersion>2.0.0</latestVersion>
    </value>
  </entry>
</configuration>

The migration-plan.xml:

<?xml version="1.0" ?>
<repository-migration>
  <entries>
    <repositoryId>3MRNK1hzB2</repositoryId>
    <protocol>svn</protocol>
    <originalName>2DIV-M</originalName>
    <dataMigrationStrategy>INLINE</dataMigrationStrategy>
    <newNamespace>svn</newNamespace>
    <newName>2DIV-M</newName>
  </entries>
</repository-migration>

For now I have reduced my original repositories.xml to only this repo but even with the full list, the page shows everything as expected.
The repository-paths.xml is missing completely and therefore I also do not have the metadata.xml.

The directory still looks the same as before:

atsvlscmp01:~$ sudo ls -la /var/lib/scm/repositories/svn
total 0
drwxr-x--- 3 scm scm 20 Sep  9 14:52 .
drwxr-x--- 3 scm scm 17 Sep  9 17:25 ..
drwxr-x--- 7 scm scm 97 Sep  9 14:49 2DIV-M
atsvlscmp01:~$ sudo ls -la /var/lib/scm/repositories/svn/2DIV-M
total 8
drwxr-x--- 7 scm scm  97 Sep  9 14:49 .
drwxr-x--- 3 scm scm  20 Sep  9 14:52 ..
drwxr-x--- 2 scm scm  54 Sep  9 14:49 conf
drwxr-x--- 3 scm scm  26 Sep  9 14:49 dav
drwxr-x--- 6 scm scm 253 Sep  9 14:49 db
-rw-r----- 1 scm scm   2 Sep  9 14:48 format
drwxr-x--- 2 scm scm 257 Sep  9 14:49 hooks
drwxr-x--- 2 scm scm  41 Sep  9 14:49 locks
-rw-r----- 1 scm scm 229 Sep  9 14:48 README.txt

I also tried to remove the sonia.scm.repository.xml from the executedUpdates.xml but this leads to some exceptions on startup.

If you need any further information please let me know.

Thanks,
Markus