I have a full site which has nodes, users, views, organic groups... What I need to do, is with f.e. module 'backup and migrate', take this site named A, into a new server, and keep all logic (content types, views, organic group settings), but have no users at all (except user 1 of course), no nodes at all, actual delete everything, but keep all the functionality of the site.

For instance, if site A has already say 5k users, and 1m nodes, start with the site B with 1 user, and not a single node. How can this be achieved? Is there a module or do I need to run a script into MySQL?

  • You can look at drush sql-sanitize (drushcommands.com/drush-9x/sql/sql:sanitize), it may fit your needs. – Jaypan Sep 9 at 22:17
  • very interesting, in the documentation it says: "Sanitize the database by removing or obfuscating user data". But i need also to remove all nodes created, i need to keep the content types, but i need to have them empty. Can the above command achieve this? – lolerogav Sep 10 at 7:34
  • Yes though you may need to customize it. – Jaypan Sep 10 at 7:40
  • thank you, i will just use drush sql:sanitize, hope this will do the job, of removing all content, and all users but user 1, and see what i get. – lolerogav Sep 10 at 9:51

In drupal 8, this would be no problem thanks to the Configuration API. For drupal 7, it is a bit harder. You should take a look at the Features module: this module can save configuration in a module. Then, you can enable that module in a new website (which would create content types, views, etc.).

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.