How to export and import a list or a library is shown here, right now!
The great thing about this is, that if you import the webpart in an subsite, both webparts are synchronised.
First you navigate to your list or library which you want to export and import to a other site.
In my case it is the list called “Testlist”.
Now click under the ribbon tab “LIST” the button “Edit list”.
The SharePoint Destroyer, ähhh Designer will open up. You have to right click the “All Items”-View and edit that in the advanced mode.
Now one of many SharePoint Designer Bugs (or Feature?).
Click in a line of the code. I clicked in line 23 (if you are interessted) (1). After that, suddenly a new ribbon tab is shown called “Web part Tools” (2).
Click on that and after that, click on “To File” (3). That is a way to save the webpart.
Save now the webpart at a location of your choice.
Open the file with an editor of your choice. I like Notepad++.
In this tutorial you will find the line 59 and in there the “WebId”. This is the reason why you can not import the webpart directly.
Because it is filled with zeros the webpart can not be imported. We will fix this right now.
In my case, I need the id of the site https://xxx.xxx.xxx.xxx.xxx.xxx.xxx.english
So, how to get the WebId? There are a couple of different methods, but for my the simplest is:
Open the SharePoint Management Shell as Administrator and type in:
$SPWeb = get-spweb http://your-url/your-subsite $SPWeb $SPWeb.Id
The $SPWeb is not necessary but I always want to double check.
Now you’ve got the WebId which you have to paste in the webpart file instead of the zeros. After that, save the file.
You can now open up a subsite of your original list or library and import the webpart.
Edit the subsite and click in the ribbon into the “Insert” Tab and then on “Upload a Web Part”. Select your webpart and upload that.
Now you can select the uploded webpart under the category “Imported Web Parts” and add it to your site.
That’s it. You’ve got your webpart exported and imported into a subsite in your farm. Nice one!
I hope you like this blog post. If so, please share it in your social networks and follow me on Twitter or Facebook.
Do you want to see a YouTube channel? Please comment below and me know.
2 responses to “Export & Import Webparts (en)”
This works beautifully for SharePoint 2013, thanks for the article. I’ve encountered one problem, when using this for Document Libraries; when folders are presented clicking a folder will return an error “item his not available and may have been deleted”. It appear the folder link uses the current parent window to construct the link, and so will not work on new pages.
Although the work around is to use a view of the Library without folders (or ideally prevent users using folders**), it leaves the resulting files unorganised when folders have been heavily used by users.
Have you encountered this problem also?
** Unfortunately we are a long way off training users with the use of tagging and metadata in libraries, so have the challenge of folders in document libraries for some time to come.
Hi Rekesh, sorry for the late response here. Busy as a bee as usual.
I highy recommend in our orginazation to don’t use folders.
Therefore I didn’t check that. Great to here a workaround and thanks for the help!