diff --git a/core/lib/Drupal/Core/Routing/MatcherDumper.php b/core/lib/Drupal/Core/Routing/MatcherDumper.php
index 97d0bf2..3249c9b 100644
--- a/core/lib/Drupal/Core/Routing/MatcherDumper.php
+++ b/core/lib/Drupal/Core/Routing/MatcherDumper.php
@@ -91,9 +91,11 @@ public function dump(array $options = array()) {
       'route',
     ));
 
+    $names = array();
     foreach ($this->routes as $name => $route) {
       $route->setOption('compiler_class', '\Drupal\Core\Routing\RouteCompiler');
       $compiled = $route->compile();
+      $names[] = $name;
       $values = array(
         'name' => $name,
         'provider' => $options['provider'],
@@ -111,9 +113,17 @@ public function dump(array $options = array()) {
     // unstable router states due to random failures.
     $transaction = $this->connection->startTransaction();
     try {
-      $this->connection->delete($this->tableName)
-        ->condition('provider', $options['provider'])
-        ->execute();
+      // During development routes might be moved to another provider (dynamic_routes
+      // or event a different module.
+      $delete = $this->connection->delete($this->tableName);
+      $or = $delete->orConditionGroup();
+      $or->condition('provider', $options['provider']);
+      if ($names) {
+        $or->condition('name', $names);
+      }
+      $delete->condition($or);
+      $delete->execute();
+
       $insert->execute();
       // We want to reuse the dumper for multiple providers, so on dump, flush
       // the queued routes.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Routing/MatcherDumperTest.php b/core/modules/system/lib/Drupal/system/Tests/Routing/MatcherDumperTest.php
index 2b7900b..60d9e7b 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Routing/MatcherDumperTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Routing/MatcherDumperTest.php
@@ -114,6 +114,38 @@ function testAddAdditionalRoutes() {
   }
 
   /**
+   * Tests that changing the provider of a route updates the dumped value.
+   *
+   * @see https://drupal.org/node/2160811
+   */
+  public function testRenameRouteProvider() {
+    $connection = Database::getConnection();
+    $dumper = new MatcherDumper($connection, 'test_routes');
+    $this->fixtures->createTables($connection);
+
+    $route = new Route('/test');
+    $collection = new RouteCollection();
+    $collection->add('test', $route);
+
+    $dumper->addRoutes($collection);
+    $dumper->dump(array('provider' => 'module_provider'));
+
+    $record = $connection->query("SELECT * FROM {test_routes} WHERE name = :name", array(':name' => 'test'))->fetchObject();
+    $this->assertEqual($record->provider, 'module_provider');
+
+    // Dump the same route again and ensure that the route has the new provider.
+    $dumper->addRoutes($collection);
+    $dumper->dump(array('provider' => 'module_provider2'));
+
+    $result = $connection->query("SELECT * FROM {test_routes} WHERE provider = :provider", array(':provider' => 'module_provider'))->fetchObject();
+    $this->assertFalse($result);
+
+    $record = $connection->query("SELECT * FROM {test_routes} WHERE provider = :provider", array(':provider' => 'module_provider2'))->fetchObject();
+    $this->assertEqual($record->path, '/test');
+    $this->assertEqual($record->name, 'test');
+  }
+
+  /**
    * Confirm that we can dump a route collection to the database.
    */
   public function testDump() {
