diff --git a/OpenSim/Data/SQLite/Resources/009_UserStore.sql b/OpenSim/Data/SQLite/Resources/009_UserStore.sql
new file mode 100644
index 0000000000..b4cc00ce4d
--- /dev/null
+++ b/OpenSim/Data/SQLite/Resources/009_UserStore.sql
@@ -0,0 +1,11 @@
+BEGIN;
+
+update users
+  set UUID = substr(UUID, 1, 8) || "-" || substr(UUID, 9, 4) || "-" || substr(UUID, 13, 4) || "-" || substr(UUID, 17, 4) || "-" || substr(UUID, 21)
+  where UUID not like '%-%';
+
+update useragents
+  set UUID = substr(UUID, 1, 8) || "-" || substr(UUID, 9, 4) || "-" || substr(UUID, 13, 4) || "-" || substr(UUID, 17, 4) || "-" || substr(UUID, 21)
+  where UUID not like '%-%';
+
+COMMIT;
diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
index e84eed53ed..d6f41fd1d0 100644
--- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
+++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
@@ -877,7 +877,7 @@ namespace OpenSim.Data.SQLite
                 DataTable inventoryItemTable = ds.Tables["inventoryitems"];
                 string selectExp 
                     = "avatarID = '" + avatarID + "' AND assetType = " + (int)AssetType.Gesture + " AND flags = 1";
-                m_log.DebugFormat("[SQL]: sql = " + selectExp);
+                //m_log.DebugFormat("[SQL]: sql = " + selectExp);
                 DataRow[] rows = inventoryItemTable.Select(selectExp);
                 foreach (DataRow row in rows)
                 {
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs
index 788a9ea578..5f9f9799db 100644
--- a/OpenSim/Data/SQLite/SQLiteUserData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserData.cs
@@ -162,7 +162,7 @@ namespace OpenSim.Data.SQLite
         {
             lock (ds)
             {
-                DataRow row = ds.Tables["users"].Rows.Find(Util.ToRawUuidString(uuid));
+                DataRow row = ds.Tables["users"].Rows.Find(uuid.ToString());
                 if (row != null)
                 {
                     UserProfileData user = buildUserProfile(row);
@@ -341,7 +341,7 @@ namespace OpenSim.Data.SQLite
             {
                 lock (ds)
                 {
-                    DataRow row = agents.Rows.Find(Util.ToRawUuidString(uuid));
+                    DataRow row = agents.Rows.Find(uuid.ToString());
                     if (row == null) infos[uuid] = null;
                     else
                     {
@@ -422,7 +422,7 @@ namespace OpenSim.Data.SQLite
         {
             lock (ds)
             {
-                DataRow row = ds.Tables["useragents"].Rows.Find(Util.ToRawUuidString(uuid));
+                DataRow row = ds.Tables["useragents"].Rows.Find(uuid.ToString());
                 if (row != null)
                 {
                     return buildUserAgent(row);
@@ -472,7 +472,7 @@ namespace OpenSim.Data.SQLite
             DataTable users = ds.Tables["users"];
             lock (ds)
             {
-                DataRow row = users.Rows.Find(Util.ToRawUuidString(AgentID));
+                DataRow row = users.Rows.Find(AgentID.ToString());
                 if (row == null)
                 {
                     m_log.Warn("[USER DB]: Unable to store new web login key for non-existant user");
@@ -531,7 +531,7 @@ namespace OpenSim.Data.SQLite
             
             lock (ds)
             {
-                DataRow row = users.Rows.Find(Util.ToRawUuidString(user.ID));
+                DataRow row = users.Rows.Find(user.ID.ToString());
                 if (row == null)
                 {
                     row = users.NewRow();
@@ -560,7 +560,7 @@ namespace OpenSim.Data.SQLite
             DataTable users = ds.Tables["users"];
             lock (ds)
             {
-                DataRow row = users.Rows.Find(Util.ToRawUuidString(user.ID));
+                DataRow row = users.Rows.Find(user.ID.ToString());
                 if (row == null)
                 {
                     return false;
@@ -589,7 +589,7 @@ namespace OpenSim.Data.SQLite
             DataTable agents = ds.Tables["useragents"];
             lock (ds)
             {
-                DataRow row = agents.Rows.Find(Util.ToRawUuidString(agent.ProfileID));
+                DataRow row = agents.Rows.Find(agent.ProfileID.ToString());
                 if (row == null)
                 {
                     row = agents.NewRow();
@@ -852,13 +852,13 @@ namespace OpenSim.Data.SQLite
         }
 
         /// 
-        ///
+        /// Persist user profile data
         /// 
         /// 
         /// 
         private void fillUserRow(DataRow row, UserProfileData user)
         {
-            row["UUID"] = Util.ToRawUuidString(user.ID);
+            row["UUID"] = user.ID.ToString();
             row["username"] = user.FirstName;
             row["surname"] = user.SurName;
             row["email"] = user.Email;
@@ -944,7 +944,7 @@ namespace OpenSim.Data.SQLite
         /// 
         private static void fillUserAgentRow(DataRow row, UserAgentData ua)
         {
-            row["UUID"] = Util.ToRawUuidString(ua.ProfileID);
+            row["UUID"] = ua.ProfileID.ToString();
             row["agentIP"] = ua.AgentIP;
             row["agentPort"] = ua.AgentPort;
             row["agentOnline"] = ua.AgentOnline;