Index: /branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StaticCache.cs
===================================================================
--- /branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StaticCache.cs	(revision 14738)
+++ /branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StaticCache.cs	(revision 14739)
@@ -222,4 +222,11 @@
       }
     }
+    // mainly for testing
+    public void DeregisterType(Guid guid) {
+      lock (locker) {
+        type2Guid.Remove(guid2Type[guid]);
+        guid2Type.Remove(guid);
+      }
+    }
     //public void RegisterTypeAndFullName(MemberSelection type) {
     //  lock (locker) {
Index: /branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCasesPersistenceNew.cs
===================================================================
--- /branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCasesPersistenceNew.cs	(revision 14738)
+++ /branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCasesPersistenceNew.cs	(revision 14739)
@@ -33,4 +33,5 @@
 using HeuristicLab.Algorithms.GeneticAlgorithm;
 using HeuristicLab.Common;
+using HeuristicLab.Core;
 using HeuristicLab.Data;
 using HeuristicLab.Persistence;
@@ -2104,4 +2105,132 @@
     }
 
+
+    #region conversion
+
+    [StorableType("F9F51075-490C-48E3-BF64-14514A210149")]
+    private class OldBaseType {
+      [Storable]
+      public ItemCollection<IItem> items;
+    }
+    [StorableType("D211A828-6440-4E72-A8C7-AA4F9B4FFA75")]
+    private class OldType : OldBaseType {
+      [Storable]
+      public IntValue a;
+
+      [Storable]
+      public ItemList<IntValue> vals;
+
+      [Storable]
+      public OldType mySelf;
+
+      [Storable]
+      public Tuple<int, int> tup;
+
+      [Storable]
+      public int x;
+      [Storable]
+      public int y;
+    }
+
+
+    [StorableType("B72C58C8-3321-4706-AA94-578F57337070")]
+    private class NewBaseType {
+      [Storable]
+      public DoubleValue[] items;
+    }
+    [StorableType("00000000-0000-0000-0000-BADCAFFEE000")] // for testing
+    private partial class NewType : NewBaseType {
+      [Storable]
+      public int a;
+
+      [Storable]
+      public int[] val;
+
+      [Storable]
+      public NewType mySelf;
+
+      [Storable]
+      public int TupItem1;
+
+      [Storable]
+      public int TupItem2;
+
+      [Storable]
+      public Point coords;
+    }
+
+    // conversion part
+    private partial class NewType : NewBaseType {
+      //[Storable(AllowOneWay = true, Name = "items")]
+      //private ItemCollection<IItem> itemsCompat {
+      //  set { items = value.Select(iv => new DoubleValue((double)(((dynamic)iv).Value))).ToArray(); }
+      //}
+
+      //[Storable(AllowOneWay = true, Name = "a")]
+      //private IntValue aBackwardsCompat { set { a = value.Value; } }
+
+      //[StorableConversion(Name = "a", Version=1)]
+      //private int ConvertA(IntValue oldValue) { return oldValue.Value; }
+      //[StorableConversion(Name = "newA", Version=2)]
+      //private double ConvertA(int oldValue) { return (double)oldValue; }
+
+      //[StorableConversion(OldNames= new [] {"x", "y"}, Name = "point", Version=2)]
+      //public Point ConvertXY(int x, int y) { return new Point(x, y); }
+
+      //[StorableConversion(OldNames= new [] {tup}, Names = [] {"TupItem1", "TupItem2"}, Version=2)]
+      //public IEnumerable<object> ConvertTup(Tuple<int, int> tup) {
+      //  yield return tup.Item1;
+      //  yield return tup.Item2;
+      //}
+      //
+      //[Storable(AllowOneWay = true, Name = "val")]
+      //private ItemList<IntValue> valCompat { set { val = value.Select(iv => iv.Value).ToArray(); } }
+      //
+      //[Storable(AllowOneWay = true, Name = "mySelf")]
+      //private NewType mySelfCompat { set { mySelf = value; } }
+
+
+
+      //[StorableConversion(SrcVersion = 1)]
+      //private Dictionary<string, object> ConvertAll(Dictionary<string, object> values)
+      //{
+      //  
+      //}
+    }
+
+    [TestMethod]
+    [TestCategory("Persistence4")]
+    [TestProperty("Time", "short")]
+    public void TestConversion() {
+      var test = new Func<OldType>(() => {
+        var p = new OldType();
+        p.a = new IntValue(1);
+        p.mySelf = p;
+        p.vals = new ItemList<IntValue>(new IntValue[] { p.a, new IntValue(2), new IntValue(3) });
+        var dv = new DoubleValue(1.0);
+        p.items = new ItemCollection<IItem>(new IItem[] { dv, dv, p.a });
+        return p;
+      });
+
+      ProtoBufSerializer serializer = new ProtoBufSerializer();
+      var old = test();
+      serializer.Serialize(old, tempFile);
+      Mapper.StaticCache.DeregisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(OldType)).Guid);
+      Mapper.StaticCache.RegisterType(StorableTypeAttribute.GetStorableTypeAttribute(typeof(OldType)).Guid, typeof(NewType));
+
+      object o = serializer.Deserialize(tempFile);
+      var restored = (NewType)o;
+      Assert.AreEqual(restored.a, old.a.Value);
+      Assert.IsTrue(restored.val.SequenceEqual(old.vals.Select(iv => iv.Value)));
+      Assert.IsTrue(restored.items.Select(item => item.Value).SequenceEqual(old.items.Select(iv => (double)((dynamic)iv).Value)));
+      Assert.AreSame(restored.items[0], restored.items[1]);
+      Assert.AreSame(restored, restored.mySelf);
+
+      string msg = Profile(test);
+      Console.WriteLine(msg);
+    }
+
+#endregion
+
     [TestMethod]
     [TestCategory("Persistence4")]
