XF 2.2 SMF 2.1 attachment import

siep

New member
We have SMF 2.1 and I have done a first test import.
Profiles, avatars, conversations and forum posts are imported succesful.

However, attachments are not imported, even though I had entered the correct path.
I have found out that the attachments, in the SMF folder, have an .dat extension.

Is the extension the problem? Is there a way to convert the attachment files so XF can import them?
 

siep

New member
Ignore the first post. I've done some research and understand now why the files are .dat.

But the problem remains - importing avatars and attachments are not successful.
It looks like the importer can not read the attachment directory.

Avatars
As for the avatars we have two directories:
/home/xxxx/public_html/avatars (which can users choose from the server)
/home/xxxx/public_html/custum_avatar (by user uploaded avatar)

The /avatars directory is prefilled and I have not changed this value.
I checked smf.php and both options (upload user or chose from server) are taken into account.
However, the /custom_avatar are not imported.

This brings me to the next subject, that is most likely causing the problem.

Attachments
Zero attachments have been imported.
The following value as path is predefined when configuring the importer:
{"1":"\/home\/xxxx\/public_html\/attachments"}

I changed this value to /home/xxxx/public_html/attachments since the prefilled value is not supported.
After several tries without succes of importing the attachments, I went to look in the database. (see screenshot)

I found the following: attachmentUploadDir and attachment_basedirectories has the same value as predefined.

To be honest, I do not understand why it has this format since the other directories are 'normally' formulated.

Moreover, I found that both the custom_avatar and the attachments are stored in the attachments table.
This explains why the custom_avatars are not imported?

I think because of the directory format ({"1":"\/home\/xxxx\/public_html\/attachments"}) the importer is not able to read the attachments table?

Can I safely edit the rows (attachmentUploadDir and attachment_basedirectories) to /home/xxxx/public_html/attachments (as /avatars etc. are also formulated that way)?
Or is there any other possible solution to import the attachments?

Thanks in advance!
 

Attachments

  • database.png
    database.png
    197.9 KB · Views: 5
  • predefined directory importer.jpg
    predefined directory importer.jpg
    642.1 KB · Views: 5

Brogan

XenForo moderator
Staff member
/home/xxxx/public_html/avatars (which can users choose from the server)
XF won't import those - it only imports avatars which members have assigned to their profiles.

I've never used the SMF importer.
Isn't there an option to define the paths when configuring it?
 

Brogan

XenForo moderator
Staff member
If the SMF importer is like the others, XF will attempt to determine the paths.

However, the attachment path doesn't look correct - try manually entering it similar to the avatar path.
 

siep

New member
If the SMF importer is like the others, XF will attempt to determine the paths.

However, the attachment path doesn't look correct - try manually entering it similar to the avatar path.
I have entered the 'normal' path: /home/xxxx/public_html/avatars, since the importer does not allow the predefined path.
 

siep

New member
Yes! The import of attachments was successful.
The problem: in the attachments folder the files were named "100_e70304151747dd0441ffbff1f88b208141b1f04e.dat"
I deleted the ".dat" at the end and this did the trick. :)

Next step, the avatars. These won't import yet.
In the avatars folder the file names are like this: "avatar_109_1554405787.png"
Do I have to delete the ".png" extenstion as with the attachments?
 

siep

New member
I also deleted the extensions of the custom uploaded avatars. File names are like: "avatar_109_1554405787"
It does not help unfortunately.

We have two folders for avatars:
1: /avatars (from server selectable avatars)
2: /custom_avatars (by user uploaded avatar)

I have done two imports, each with one of the paths.
Result /avatars:
The avatars selected from server are imported and shows up in profile of users who selected one.
The custom uploaded avatars are not imported at all.

Result /custom_avatar:
The from server selectable avatars are imported to "/data/avatars". However, the avatars does not show up in profiles.
The custom uploaded avatars are not imported at all. :eek:
 
Top