Copy SharePoint Lists between sites with different language templates

An easy way to copy a list with content between to sites is to create a list template, upload it in the other site to the list template gallery and create a new list with the uploaded template.

The problem starts when the site templates have different languages. For example you create a list template in a site with english site template and you upload it to a site with a german site template, you'll not see the template in the create page.

A way to change this ist to modify the.stp file, which is created when you make the list template. SO the first steps are:
  1. Create a list template. You can do this in the list settings. Just click "Save list as template" and give in the the filename and the template name.
  2. Download the created template to a local folder.

Extract the template file

Now we will modify the .stp file. An .stp file is nothing more than a microsoft cabinet file. Therefore rename the file from "mylist.stp" to "mylist.cab". You can now open the file and see all the compressed files inside.

The next step is to make a local folder e.g "C:\temp\mylist" where we'll copy all files within the cab file. So open  the cap file and drag all files inside to the mylist folder. As it's a cab file you can't copy the files, you have the drag them with the mouse.

Afterwards open the manifest.xml in the mylists folder and change the language code within the xml to the destination language code. (See Language Codes )

<Language>1031</Language>

Create a new template

In this step we create the stp again. Unfortunately it is not so easy as it seems to be. First of all we have to create a .ddf file. Create a new file in the mylist folder and rename it to "definition.ddf".

Open the .ddf file and paste the fallowing code inside:

; DIAMOND Directive File (.ddf)
.OPTION EXPLICIT
; Generate errors on variable typos
.Set CabinetNameTemplate=mylist.stp
.Set Cabinet=on
.Set Compress=on

;The files specified below are stored, compressed, in the cabinet file
30000000.000
manifest.xml

In the last section write down all the files which should be within the new .stp file. These should be all except the .ddf file.

You can also change the CabinetTemplateName. This is the name of the file, but this is not important for us.

Create cabinet

Open the DOS command promp and go to the mylists folder. Type the following command:

makecab /f definition.ddf



The result should end in a mylist.stp file within a subfolder. You can now go and upload the new .stp file to the list gallery of your destination site.

The list template should be finally visible in the list create dialog.

Comments

Vaqar Hyder said…
Thanks a million dear Baris...
That was really helpful.
Keep up the good work.
Regards
Vaqar Hyder
Unknown said…
Thanks Baris, that was helpful.
But I still have a problem here. I've two lists, one of them have a field with type "look up" to the title of the other list .. When I use this method with the two list(I created the PrimaryKey list first) the lists is created successfully but with no records in the lookup field.
Anonymous said…
Hi,
I followed everything u said and uploaded the newly created STP file in the template gallery. But i cant see this file listed in the 'create new list' section. Any help wud be much appreciated.

Thank you
Baris Bikmaz said…
Hi,
when you not see the file, it is mostly a language problem. Is it the right language code ? The site and the list must have the same language codes. What have you done so far ?


Anonymous said…
Dear Baris,

Thanks alot! It worked well after I eliminated the line containing
30000000.000

Axel Neuhaus
Winterthur
Ghofrane Rhimi said…
Thank youuuuuuuuuu you are genious !
Gianni Zanetti said…
Merci, thanks Baris
Anonymous said…
also for me It worked well after I eliminated the line containing
30000000.000

Thanks!!!

Sergio
Andrey said…
I solved this problem using visual studio to create .cab. Thank you for good idea with locale changing!
Jonatan said…
Man you are a fucking god! Thank you so much!
Unknown said…
Man you are a god, thank you so much!
Unknown said…
man you are a god! thanks a lot! regards from Argentina
JJ said…
Thank you very much Baris! You rock! It solved one big issue for me. Hope you restart posting new articles! Cheers!

Popular posts from this blog

Ways to redirect http requests in SharePoint

Open SharePoint 2010/2013 Display, Edit, New Forms in Modal Dialogs

How to create a FAQ in SharePoint with OOB features