Here are the steps:
Open a site where we want to create a backup.
Now I am going to backup the site.
Open “SharePoint management shell”.
Run as elevated privileges.
Command: Backup-SPSite -Identity URL -Path “location”.
Backup-SPSite -Identity “http://site/test” -Path “c:\backup\test.bak”.
So site backup has been taken successfully.
Open central administration.
Now create a team site to restore the backup.
Now we will restore the backup to this site.
Restore-SPSite -Identity URL -Path “backup file location” -Force.
Restore-SPSite -Identity “http://trenmax-sp/sites/test2/” -Path “c:\backup\test.bak” -Force.
Select the default is ‘Y‘, so the site has now start restoring.
Now the site has been restored successfully into this site.
Now refresh the page.
It has been restored successfully into test2 site.