Index: metadatamover.cpp
===================================================================
--- metadatamover.cpp   (revision 1125616)
+++ metadatamover.cpp   (working copy)
@@ -242,6 +242,10 @@ void Nepomuk::MetadataMover::updateMetad
                               from.url(KUrl::AddTrailingSlash) );
         kDebug() << query;
         Soprano::QueryResultIterator it = m_model->executeQuery( query, Soprano::Query::QueryLanguageS
parql );
+        
+        const QString oldBasePath = from.path( KUrl::AddTrailingSlash );
+        const QString newBasePath = to.path( KUrl::AddTrailingSlash );
+       
         while ( it.next() ) {
 
             // the resource URI of the resource to update
@@ -251,8 +255,6 @@ void Nepomuk::MetadataMover::updateMetad
             const KUrl url = it[1].uri();
 
             // now construct the new URL
-            const QString oldBasePath = from.path( KUrl::AddTrailingSlash );
-            const QString newBasePath = to.path( KUrl::AddTrailingSlash );
             QString oldRelativePath = url.path().mid( oldBasePath.length() );
             KUrl newUrl( newBasePath + oldRelativePath );
 