I'm migrating D6 to D7 and have a specific node type with attachments.
I've imported all of the attachment files using a dedicated file migration. The files are in place and have corresponding entries in file_managed table.
The node migration runs without errors or messages and creates the destination nodes, but does not attach the files. From what I've read, nominating MigrateFileFid is the way to go on this, but that seems to cause warnings when the migration config is saved (whether or not the specified fields are set to DNM):
"field_attachment:destination_dir" was used as destination field in "" mapping but is not in list of destination fields
"field_attachment:destination_file" was used as destination field in "" mapping but is not in list of destination fields
"field_attachment:file_replace" was used as destination field in "" mapping but is not in list of destination fields
"field_attachment:source_dir" was used as destination field in "" mapping but is not in list of destination fields
"field_attachment:urlencode" was used as destination field in "" mapping but is not in list of destination fields
Any pointers would be very welcome.
(Edited to actually include the attachment)
Comment | File | Size | Author |
---|---|---|---|
#11 | Screenshot_20150409-migd2d_attachment-setup.png | 20.52 KB | Louis Delacretaz |
#8 | 2015-03-11_11-11-53.png | 23.19 KB | joep.hendrix |
#8 | 2015-03-11_11-11-27.png | 10.81 KB | joep.hendrix |
#1 | Screen Shot 2014-05-27 at 12.37.08 PM.png | 98.71 KB | thekenshow |
Comments
Comment #1
thekenshow CreditAttribution: thekenshow commentedComment #2
thekenshow CreditAttribution: thekenshow commentedWorking on this more, it looks like fid is not available for mapping when using migrated2dwizard to set up the migration. So although [field_attachment:file_class] option appears on the mapping form generated by migrated2dwizard, there's no way that MigrateFileFid can work.
If I'm right, then this recommendation below only applies when coding a custom migration, not when using migrated2dwizard:
If that is the case, is it possible to hook into/extend what migrated2dwizard already provides to add fid to the node migration while leaving everything else (users, taxonomies, files) as is? I'm looking at migrate_d2d_example but it appears to register a completely separate migration instead.
Comment #3
thekenshow CreditAttribution: thekenshow commentedPicking this up again, I decided to revisit my original, successful node migration.
First, I rolled back the separate file migration, ensured all the destination files were deleted.
Next, I re-ran the Import from Drupal wizard and when prompted, I provided a file spec (the source is on the same server):
/var/www/vhosts/example.com/httpdocs/live/sites/default/files
Then I added only the following mapping (the rest of my original mapping was preserved). Note that the source nodes are using standard Drupal file attachments, not CCK.
Attachment (file) [field_attachment] --> Upload [upload]
Finally, I ran the migration from drush. All nodes were migrated, but no file attachments and Messages log was filled with:
The values correspond to nids and fids but clearly the migration isn't handling them properly. Feels like this is exactly what the UI should handle - am I missing something?
Comment #4
seanrHas anyone figured this out? I've got the exact same issue.
Comment #5
bmx269 CreditAttribution: bmx269 commentedI am stuck with this as well, can anyone share their success please.
-Trent
Comment #6
mikeryanFirst off, the messages you see when setting the file_class default value to MigrateDestinationFid are notices, not errors, and can be safely ignored - the issue here is that those subfields are not available (because not necessary) for MigrateFileFid, but we don't have a good way to remove them from the form, so we get the complaints.
Could you be more specific about "fid is not available for mapping when using migrated2dwizard to set up the migration"? The source field for the file field mapping should be the file field value from the source, which should contain a fid.
"The specified file 2445 could not be copied to private://example-resource-media/2445" says to me you're not using MigrateFileFid - the incoming value is a fid, but without specifying MigrateFileFid it's being interpreted as a filespec.
Comment #7
mikeryanComment #8
joep.hendrix CreditAttribution: joep.hendrix commentedAm I allowed to reopen this issue?
I am not able to migratie node file references through th UI.
Import setting
Result
Any clues?
Comment #9
mikeryanYou have to set the default value of the file_class subfield (immediately below the file field mapping itself) to MigrateFileFid.
Comment #11
Louis Delacretaz CreditAttribution: Louis Delacretaz commentedRan migrate_d2d files OK and can see that the files arrived in the private:// directory.
Importing creates the nodes without errors but there is no files attached.
Is there a log anywhere I can inspect to see whats going on?
My file attachment setup is attached as Im Ive misunderstood the config.
Comment #12
niner94949 CreditAttribution: niner94949 commented@Louis Delacretaz - Did you ever find a solution? I'm running into the same problem.
Comment #13
sw_msnd CreditAttribution: sw_msnd as a volunteer commentedCan someone help me with getting started with migrate_d2d? I am having issues connecting to the remote database where my old drupal db is installed in step one: credentials. The database is sitting on a different apache webserver, and I am able to connect to it remotely using mysql workbench from my local machine. Below is the error I get when trying to connect via the wizard
"Failed to connect to source database, message returned: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES)" Can I actually do this? Or do I have to copy the entire db to the new webserver?