Jump to content

Migrating database from SqlLite to MySQL on Linux host


Recommended Posts



I am using PlasticSCM for some time and i have server installed on Linux (debian squeeze) machine. It's great but now I wanted to migrate from SqlLite to MySQL.


According to this the easiest way is to use admintool.exe, but:


- there's no script to run admintool in the server directory

- executing exec "/opt/plasticscm5/config/mono_setup" mono admintool.exe terminates the shell (?!)

- running mono admintool.exe produces this exception



Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: AND data length expected 128, read 0

Parameter name: stream
  at System.Drawing.Icon.InitFromStreamWithSize (System.IO.Stream stream, Int32 width, Int32 height) [0x00000] in <filename unknown>:0
  at System.Drawing.Icon..ctor (System.Runtime.Serialization.SerializationInfo info, StreamingContext context) [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.ObjectRecord.LoadData (System.Runtime.Serialization.ObjectManager manager, ISurrogateSelector selector, StreamingContext context) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.ObjectManager.DoFixups () [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject (System.IO.BinaryReader reader) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (BinaryElement elem, System.IO.BinaryReader reader, Boolean readHeaders, System.Object& result, System.Runtime.Remoting.Messaging.Header[]& headers) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream) [0x00000] in <filename unknown>:0
  at System.Resources.ResourceReader.ReadNonPredefinedValue (System.Type exp_type) [0x00000] in <filename unknown>:0
  at System.Resources.ResourceReader.ReadValueVer2 (Int32 type_index) [0x00000] in <filename unknown>:0
  at System.Resources.ResourceReader.LoadResourceValues (.ResourceCacheItem[] store) [0x00000] in <filename unknown>:0
  at System.Resources.ResourceReader+ResourceEnumerator.FillCache () [0x00000] in <filename unknown>:0
  at System.Resources.ResourceReader+ResourceEnumerator..ctor (System.Resources.ResourceReader readerToEnumerate) [0x00000] in <filename unknown>:0
  at System.Resources.ResourceReader.GetEnumerator () [0x00000] in <filename unknown>:0
  at System.Resources.ResourceSet.ReadResources () [0x00000] in <filename unknown>:0
  at System.Resources.ResourceSet.GetObjectInternal (System.String name, Boolean ignoreCase) [0x00000] in <filename unknown>:0
  at System.Resources.ResourceSet.GetObject (System.String name, Boolean ignoreCase) [0x00000] in <filename unknown>:0
  at System.Resources.RuntimeResourceSet.GetObject (System.String name, Boolean ignoreCase) [0x00000] in <filename unknown>:0
  at System.Resources.ResourceManager.GetObject (System.String name, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Resources.ResourceManager.GetObject (System.String name) [0x00000] in <filename unknown>:0
  at admintool.MainForm.InitializeComponent () [0x00000] in <filename unknown>:0
  at admintool.MainForm..ctor () [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) admintool.MainForm:.ctor ()
  at admintool.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0


Is there any easy way to do the migration? I've searched the forums and I couldn't find the answer.

Link to comment
Share on other sites



Yes, it seems that there is an issue when running "mono admintool.exe". Most probably related to an icon. We will review it, but regarding your migration interest, you have two options:



1)  Export your repositories using "cm fast-export" comand. Then you can configure your Plastic server to use MySQL and finally import the packages again to Plastic.


2) You can mount an extra server using MySQL as backend and perform a sync between both servers. After that, you can start using your Plastic server (MySQL backend)


If you need more information about the two workaounds, let us know.




Link to comment
Share on other sites

  • 3 weeks later...

Thank you Carlos for your answer!

For some reason I haven't received forum notification, so I noticed it today :-)


I have done the migration and I wanted to share how I did it with everyone. I don't know if it is simpler than cm fast-export but it worked for me without any issues. I have quite a lot repositories and branches and I had problems with understanding how syncing is working. Here are the steps:


1. Install PlasticSCM on Windows with Server component. Most probably you already have it.

2. Stop the windows server service in Services panel and linux server service as well

3. Copy all *.sqlite and *.config files from linux host server directory into windows server directory (Program Files/PlasticSCM5/server)

4. Run admintool.exe on Windows host

5. Do the migration using remote MySQL connection (need to bind MySQL on external interface and set the privileges)

6. When the process is finished copy back (from windows to linux) db.conf

7. Modify db.conf and change Server=remotehost.com to Server=localhost (in case when MySQL is on the same host)

8. Optionally restore MySQL bind/privileges settings

9. Run linux server service




Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...