2

What is the right way to reinstall a few tables (I've deleted them because I am using multisite installation) but now I can't get language switcher (and language detection) work. So I need to bring them back.

  • 1
    The right way would be to restore your backed up version of the database, or at least restore the backup to a temporary database so you can inspect both and merge the changes – Clive May 7 '12 at 13:05
  • Yeah i see.. I might have used trancate if they were existing. But ive deleted them. So isnt there any other way then just back up those tables? – Rootical V. May 7 '12 at 13:07
  • 1
    If you've deleted the tables then any data will be lost (unless you've got a backup). But if you just need the tables to exist in their original state, just install Drupal quickly into another database and copy the tables across. There are ways to do it using the API if that's not an option – Clive May 7 '12 at 13:09
  • Could you please mention a function or something? – Rootical V. May 8 '12 at 9:47
  • 2
    Personally I'd use drupal_install_schema(), and call MODULENAME_schema(), where MODULENAME is the name of the module responsible for implementing the table you're trying to restore. For example to reinstall the session table it would be something like: $schema = system_schema(); drupal_install_schema($schema['sessions']); – Clive May 8 '12 at 9:53

Your Answer

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

Browse other questions tagged or ask your own question.