2

Let me preface by saying that I have read this page by Microsoft: http://support.microsoft.com/kb/841057/en-us

I have not understood it completely which is why I am here, We are currently in a tough migration Phase and due to the nature of the migration we are using some metadata is being lost. So when files are uploaded from one server to another using a webclient method and a service account it is obvious that some data will either go missing (due to a multitude of reasons) or simply be wrong.

One of these cases is "Last Modified/Edited by" for certain items. Assume I had an item called "Yearly_Review123.docx" and the last person to touch or modify that file was called "John Snow". After the upload to the 2010 server that data will become missing, i could open the SQL Management Studio, lookup the file by its uniqueid or other properties and simply edit the "Last Edited/Modified by" to say John Snow or link to that Username.

Question: Would this violate Sharepoints/Microsofts continued support policy or would this be okay? I have been told by many times by people far more senior than me that as long as you don't manipulate the DB Schema you are allowed to edit files. But reading that article and especially the:

Adding, changing, or deleting any data in any table of any of the databases for the products that are listed in the "Applies to" section

Adding, changing, or deleting any columns in any table of any of the databases for the products that are listed in the "Applies to" section

part is kind of saying not to touch anything. I mean essentially it also says that doing read-only activities such as querying the database is prohibited.

So essentially my question is this:

1) If i modify the "last edited/modified by" value in the database then Microsoft is allowed to cancel their support to this product correct?

2) Is there an alternative and or recommended way to make these changes?

3 Answers 3

2

You can update system properties (Created, Created By, Modified, Modified By) using code like that:

 using (SPSite site = new SPSite("Your site url"))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    var list = web.Lists.TryGetList("Your list name");
                    var query = new SPQuery()
                                    {
                                        Query = "Your CAML query",
                                         ViewAttributes = "Scope=\"Recursive\""
                                    }
                    var items = list.GetItems(query); 
                    var userID = web.EnsureUser("Your User Login").ID;
                    foreach (var item in items)
                    {
                        item[SPBuiltInFieldId.Created_x0020_By] = userID; //<SPFieldUserValue>
                        item[SPBuiltInFieldId.Modified] = DateTime.Now;
                        item[SPBuiltInFieldId.Modified_x0020_By]= userID; //<SPFieldUserValue>
                        item.UpdateOverwriteVersion();
                    }
                }
            }

link to source

2
  • Can you change your " to normal ones so the code compiles? That would be awesome! :) Dec 19, 2013 at 14:32
  • Andrey, Thank you very much for the code sample, i will try and put it to good use once i figure out a way to make apt/reasonable comparisons between the old system and the new system. Unfortunately we are working with custom contenttypes and the content itself needs to go through a mapping/transformation process when deployed to the 2010 systems, but this definitely solves a few questions I have had. Thank you again and have a nice day!
    – Orbital
    Dec 19, 2013 at 15:01
2

Simple answer: Yes it is forbidden. From my point of view you have following options:

  1. Do a proper database migration from 2007 to 2010. Metadata will remain untouched.
  2. Do the webclient migration and you can create a PS script that will modify the Created and Modified By fields for you and it will be supported.
  3. Look up a third party migration tool that will support you in that process.
1
  • Vojtech Nadvornik, 1) This is unfortunately not an option, mostly because we cannot patch everything to the most recent/recommended levels and because the content itself needs to be modified/adjusted for a new environment, following a new businesslogic etc. There are also other roadblocks and microsoft themselves have been here and confirmed that we are out of "moves" in terms of what we can do. They themselves are searching for a solution. 2) Makes sense, i will research these options. 3) Forget it, none work/will work we had to code/design our own migration tool Thank you very much :)
    – Orbital
    Dec 19, 2013 at 14:41
0

I highly recomend you work to migrate that data and then use supported methods via the API to make those changes (you can change created by/modified by via API) to fill in the gaps, such as what @andreyungar proposed.

That being said once the data is inside a supported database structure, you can query and pull data from the old database as needed. So you could write a direct query or PowerShell to pull information about your data and then use the API on the new 2010 farm to write that back to the documents. Certainly not a quick solution but it will bring you back into the supported state.

A note about supportability. This doesn't mean Microsoft won't try to help you, but it does mean, if you were to open a premier ticket they would not promise a resolution, it's best effort and if you are in that position you would probably be right back here looking to do the same thing.

2
  • Thank you for your comment Jesus, For the past two months I am living and breathing Sharepoint and reading through every conceivable book and watching videos to suck in as much information as I possibly can. Getting the Data from 2007 to 2010 is a little bit tricky right now. This project has been going on for 14 Months and I've only joined in November. Right now the migration has to happen by creating a structured XML list using the API's and then transfering the files by creating a webclient upload to the new system. Needless to say a lot of data is being lost this way including metadata
    – Orbital
    Dec 19, 2013 at 15:22
  • My Job right now is to ensure data Integrity and smooth content migration from 2007 to 2010 but the amount of roadblocks are insane. As i mentioned in another comment Microsoft services themselves were here already and have commented on how they do not know on how to improve upon the method in literally any kind of way, since the standard methods are not doable and the environment/requirements are highly complex. Ill open a thread about this once i have the information gathered to see if anyone has any clever suggestion at all
    – Orbital
    Dec 19, 2013 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.