1

Our website uses VBO + Views Admin screen for the admin/people screen. Today one of the user admins deleted some old user accounts, by checking the checkbox next to the names and selecting the "Delete" option from the Actions dropdown. What he didn't know (+ I didn't know) was that by using the "Delete" option he also inadvertently deleted all the content created by those users as well.

I've got a backup of all the nodes that have been deleted, however I'm at a bit of a loss on what's the best option to restore these. The site has 10+ content types, and loads of custom fields (field_x_revision + field_x_data tables!! for each field). I need to preserve those node ID's. I'm going to be doing this locally and the once I've got a completely merged database I'm going to put it back on the live site.

Are there any drupal modules that can export nodes and also import them (and preserve the old node id's)?

11
  • You tagget it node-export... can't Node export do it already?
    – Mołot
    Jun 7, 2013 at 13:25
  • 2
    The nid column is a serial/autonumber controlled by the DBMS, so short of recreating those nodes manually with the correct nids, there isn't really. You might want to have a look into the UUID module, built to solve this sort of problem for the future
    – Clive
    Jun 7, 2013 at 13:25
  • 1
    This is the achilles' heel of Drupal right now, and is planned to be solved in 8 (so I've heard), but there's not much to work around this besides node_export, and have two completely similar environments to work with. Jun 7, 2013 at 13:31
  • What @inertialmedia said. Things are vastly better in Drupal 8 (I've seen it with me own eyes :P), but for now Drupal really falls down in the areas of content staging/config management. We just have to do the best we can until D8 is out...
    – Clive
    Jun 7, 2013 at 13:33
  • 2
    200 nodes deleted, it's going to be a long friday. Thanks everyone for the help.
    – Beebee
    Jun 7, 2013 at 13:49

1 Answer 1

1

If your backup contains the previously existing users, you could try to recreate your production site locally... Here are the steps I would follow (never tested though):

  • install a local drupal site with your backup (files should be restored as well) in the production site, via VBO

  • put your production site in maintenance mode

  • target all the new / updated nodes since the incident

  • export them via Node Export

  • reimport them locally (the nids should be preserved thanks to NodeExport and UUID)

  • reinstall your local db in production

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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