Recently, we have observed that the save the list as a template option is missing for the Modern SharePoint Online site. Because of which many users are getting confused about how to restore their existing list to another site which is mostly required and quite normal in terms of SharePoint. Save as s template was a very handy option to copy list definition as well as to migrate its contents in some cases.
Modern SharePoint Online is missing save as a template option for the SharePoint list.
We restore existing lists or libraries for various reasons,
  • To restore existing list(s) into another site collection because of similar requirements for restoring list definitions
  • Sometimes, we create development and production site collection. We create several lists and libraries on the development site and then after the completion of the development task, we again retore those lists and libraries into production.
  • Sometimes, we retore the list in the same site collection with a different name to reuse the existing list and modify or use it as it is for another requirement.
  • In some cases, we might need to restore into another tenant as well if we are working with a third-party or vendor for development or some purposes.
  • In some cases, we use this option to migrate list or libraries contents
This is one of the general requirements to restore the existing list and library. Since the missing save as a template option is missing in modern SharePoint, we have some alternative ways to accomplish the same restoring of the list.
In this article, I will show you the different ways of restoring the list from existing in Modern SharePoint. So far, I have found 3 alternative ways
  • Option 1: Create a new list from an existing list
  • Option 2: By using PnP, save a modern list as a template and restore
  • Option 3: By enable custom script in SharePoint Online

Create a new list from the Existing list

This option is quite fast, easy, user friendly, and most recommended where you can create a new list from the exiting option from another site collection.
Firstly, we need to create a new list from Site contents as shown
Open Destination Site collection -> Site Contents -> Click New -> Select List
Next, we will choose an option from the existing list as shown,
After selecting, from the existing list, you will get the option to choose site collection and list within that site collection as depicted,
Select the Site collection from which you want to restore the list and the list. Then you will get the option to add the list in the current site collection as demonstrated,
You can give a name, description, and option to show in site navigation as like creating a new list.
This is how you can restore the existing list template.
However, this option has some limitations which are listed below,
  • Some lists might not be compatible which has lookup columns
  • You cannot restore data
  • Some legacy lists cannot be restored
  • Some site collections are showing incompatible lists.

By using PowerShell, Save a modern list as a template

Using PowerShell, we can save a list as the template in modern sites both in team and communication sites including list definition and data.
For this option, you need to have PnP PowerShell installed on your pc. You need to run following PowerShell.

First, we are defining siteUrl, listName (a list which we want to save as a template), templateName, and path variables with values.
Then connect to SharePoint online.
At last, we are extracting list and data with these commands,
Additionally, we can add filters in data query.
Now, we have saved the list as a template. The second step is to add the template into the destination site collection.
We can achieve this by running this PowerShell.
This execution of command takes few minutes depending upon your list data.
After this, if we create a new list, we find this template in our site collection and we can restore the list.

By enabling custom script in SharePoint Online

Another option (not recommended) is by enabling custom scripts through SharePoint Admin Centre or PowerShell.
You can login to SharePoint Admin Centre -> Setting -> classic setting page.
Additionally, we can enable the specific site collection using the below PowerShell script.
To apply the changes for enabling custom scripting might take up to 24 hours.
After enabling the custom script, we will need to go to list settings, and in the above URL, just replace listedit.aspx with savetmpl.aspx manually to save the list as a template.