When I break my site I create a new one from a backup and give it a different name from the original, for example:

I do a fresh install of drupal and call the site 'mysite' then a week later I break it. I then restore a backup and call it 'mysiteRevA' when this one breaks I use a backup of 'mysiteRevA' and create 'mysiteRevB' and so on. I'm not very good at fixing errors so I do this a lot!

The issue is that say I'm working on 'mysiteRevC',if I look in the sites folder there are folders called 'mysite' and 'mysiteRevA' and 'mysiteRevB' and 'mysiteRevC' reflecting all the restorations I have done. My first question is how can I remove these additional folders and question 2 is what should I do to avoid this in the future.

It might be that every restore has to use the original name, but wouldn't this mean overwriting the original site? I don't want to do this because I worry that if the restore doesn't work and I've deleted the original I'll have lost everything.

  • What are you doing to break the site? If it's code changes then just revert the code changes (via GIT). If it's DB changes then just restore a backup of the DB. I don't understand why you would have all these folders.
    – Felix Eve
    Sep 14 '18 at 9:14
  • Hi. I often lose the site while updating core or commerce with composer. Other times its been deleting taxonomy terms which are in use or applying a patch to my purchased theme, it can be a variety of reasons. Maybe I'm over cautious because I always restore the whole files system as well as the DB. I'm a site builder not a developer. I've had sql backups not work on a few occasions so when I break a site I dare not try to import one but prefer to start again from a whole site backup. I'm quite far into building my current project, is removing these redundant folders an option?
    – 8en
    Sep 14 '18 at 9:37
  • I don't see why not. Delete them and see it it still works. You can always just revert your changes if you run into difficulty. You are using version control right?
    – Felix Eve
    Sep 14 '18 at 9:52
  • huh! version control, whats that!? No I'm not but I'll find out what it is and start using it right away. Ok I'll create 'mysiteRevD' and try deleting, see what happens. How do I avoid this in the future? Using sql imports and my fingers crossed is not my preferred option :)
    – 8en
    Sep 14 '18 at 9:58
  • GIT is the version control system used by Drupal. Here is a beginners tutorial on that. It keeps a complete history of all your code changes and allows you to commit all your changes at certain points. Think of this like "saving your game". I think if you break your site is important to understand how you broke it and why it's broken. This will help you understand if the problem is with the codebase or the DB.
    – Felix Eve
    Sep 14 '18 at 10:24

I went into the sites folder and just deleted the folders which reference a previous restore point and everything still works fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.