To restore the old OneDrive when a new OneDrive with the same URL has been created, you will need to follow these steps:
- Check if the old OneDrive is available for restoration: Use PowerShell to check if the deleted OneDrive exists. Run the following command:
This will list all deleted personal sites, and you can check if the old OneDrive is listed.Get-SPODeletedSite -IncludeOnlyPersonalSite | FT url - Restore the old OneDrive: If the old OneDrive appears in the results, you can restore it using the following command:
ReplaceRestore-SPODeletedSite -Identity <URL><URL>with the URL of the old OneDrive. - Assign an administrator: After restoring, you may need to assign an administrator to the restored OneDrive to access the data:
Again, replaceSet-SPOUser -Site <URL> -LoginName <UPNofDesiredAdmin> -IsSiteCollectionAdmin $True<URL>with the URL of the restored OneDrive and<UPNofDesiredAdmin>with the user principal name of the desired admin. - Handling conflicts: If the commands
Restore-SPODeletedSiteandRemove-SPODeletedSitedo not work due to the existence of the new OneDrive, you may need to consider renaming or removing the new OneDrive if it is not needed, as having two OneDrive sites with the same URL can create conflicts. - Permanently delete the new OneDrive (if necessary): If you decide to delete the new OneDrive, use the following commands:
Be cautious, as this action is irreversible.Remove-SPOSite -Identity <URL> Remove-SPODeletedSite -Identity <URL>
By following these steps, you should be able to restore the old OneDrive and access the documents that were previously stored there.
References: