Hello everyone

I'm in the process of importing an old, slightly customized phpbb forum into Drupal 7.22.
I've been using phpbb2Drupal, and trying to accommodate the needs of the module by modifying the old phpbb database until it 'fit'.
Well, at some point I was succesful, and most of the data was moved.
However, since not _all_ of the data was moved, I've got some modifications of the phpbb to do yet before the migration can be a full success.

And therefore, I'd like the Drupal forum to return to the state it was in before the migration.

I cloned the Drupal database before performing the migration, and I'm thinking that I can just point the Drupal site in the direction of the cloned database rather than the one it's using now.

However, in researching this, I find that it might not be as simple as that - and I'm a bit uncertain.

I'm new to Drupal, and I'm afraid I'll break the installation somehow and cause a world of trouble (for myself and others) if I point at the database clone and Drupal gets "confused".

Does anyone know if it's possible to just point Drupal to a cloned database without any hitches?

Comments

chriso’s picture

You can 'safely' alter the settings.php file found under the /sites directory (unless you're doing clever things, it'll be at /sites/default/settings.php).

That's where you can alter the host, port, database name or credentials Drupal uses to find its database. In your case it might be as simple as editing the name of the database, if your clone db is running alongside the working-copy db where you're migrating the forum.

99.9% of the time repointing to a copied DB via settings.php is going to be fine. The main thing to watch out for is if you've changed the version or location of any code (module/theme) files since taking that database snapshot; Drupal can freak out a little in that situation.

If you can clear the Drupal cache after switching the DB it will probably help most things that might look odd. If you can't get to the admin interface for that and you don't have Drush installed, you can truncate all the tables beginning with "cache", except for "cache_form" which won't help you here anyway. If you have moved code and something breaks because of it, repairing might mean hand-editing the system table a little. If you get yourself to that point, you should pause and take a look at https://drupal.org/project/registry_rebuild

Reefersleep’s picture

Hello Chriso

Thank you so much for your very thorough answer! I feel like Drupal is sometimes a bit unstable in sort of a dark magic gone wrong kinda way, so it really helps when someone steps up and takes me by the hand :)

Thank you!