I try to preform a user import from D6 to D7. The D6 database has a prefix, 2011_ When filled in on the first screen, I get errors for several tables (users, roles, variable, users_roles) that they don't exist. When I make a copy of that tables whitout the prefix, all goes well.

CommentFileSizeAuthor
#5 support_prefix-2003384-5.patch635 bytesrob_johnston

Comments

mikeryan’s picture

Title: Table prefix from source db not saved » migrate_d2d does not support prefixed databases
Priority: Major » Normal

Better description.

I haven't had a prefixed scenario to test migrate_d2d with, I don't doubt that it's broken. If someone dealing with prefixed databases can try submitting a patch, that would be great.

ratatine’s picture

I too face this issue and am willing to test for you but I do not know what to change. It appears this is all contained in the migrate classes. The variable for the prefix (drupal_ in my case) is gathered by the wizard but I don't see a way to pass it to the migrate class.

That said any suggestions and I can try them. (Including if anyone to call me which files need changing.) The prefix in my destination drupal 7 install is the same. Thanks.

ParisLiakos’s picture

it seems that the prefix field in the form, has the name db_prefix while it should be just prefix

doing something like

$this->database->prefix = $this->database->db_prefix;

in MigrateD2DWizard->connection before calling Database::addConnectionInfo seems to do the trick for now

ecmu’s picture

To be precise, the code to be added is :

      $this->database['prefix'] = $this->database['db_prefix'];

before :

     Database::addConnectionInfo($connection_key, 'default', $this->database);

in "connection()" function of "migrate_d2d_ui.migrate.inc".

That worked for me...

rob_johnston’s picture

Status: Active » Needs review
StatusFileSize
new635 bytes

Patch attached for comments in #4 (it worked for me too).

robcarr’s picture

Rolled the patch at #5 (against latest DEV) and the prefixes work

robcarr’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
bisonbleu’s picture

Ran into this prefix issue. The patch in #5 works for me. Thanks all!

danepowell’s picture

Yep #5 works.

jygastaud’s picture

#5 works to me to on lastest DEV.
Thanks a lot.

mikeryan’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks! Unfortunately I botched the commit message though... http://drupalcode.org/project/migrate_d2d.git/commit/ecb550c

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.