Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently, to my knowledge, deleted sites can not be restored. The only way I am personally aware of is to do the following:
1. Create a new site.
2. Make a manual backup of new site.
3. Copy a backup file from the deleted site over the manual backup of the new site.
4. Restore from the overwritten manual backup.
This process isn't exactly intuitive.
The proposed solution (in my mind) would be to allow for a restore task to be actioned directly on the deleted site itself.
Comments
Comment #1
Deciphered CreditAttribution: Deciphered commentedSo i have begun this issue, firstly by allowing the 'restore' task to be triggered on a 'Deleted' site, which was easy enough in itself.
However, when triggering a restore task on a deleted site the following error is encountered:
Could not find a Drupal settings.php file at ./sites/default/settings.php.
This can be seen by installing the Hosting Site Backup Manager module and browsing to the Backups page of a deleted site (if it has a backup) and running the restore task.
From what I can tell, the major issue here is that the provision side of things both tries to bootstrap and connect to the database prior to running the restore task, which is not possible given that there is no codebase/database for a deleted site.
I suspect that instead of using the 'restore' task, the/a 'deploy' task will need to be used instead.
Comment #2
Deciphered CreditAttribution: Deciphered commentedOk, proof of concept time, this is using the 'restore' task, even though it probably doesn't need to/shouldn't be, but it does work... with at least one issue (you need to run the task twice as the first time the site context isn't passed) that does need to be fixed and a few additional safety checks.
Hosting: http://drupalcode.org/sandbox/deciphered/2001932.git/shortlog/refs/heads...
Patch: http://drupalcode.org/sandbox/deciphered/2001932.git/patch/f0395d7889bbc...
Provision: http://drupalcode.org/sandbox/deciphered/2005700.git/shortlog/refs/heads...
Patch: http://drupalcode.org/sandbox/deciphered/2005700.git/patch/8c5adf38c4ab5...
Comment #3
ergonlogicNote that I closed #898800: Allow restore of deleted site as a duplicate, since there's code over here. The discussion is worth noting though.
Comment #4
ergonlogicFeature requests should be against 7.x-3.x. Marking as postponed, since I don't believe anyone is working on this at the moment.