Support » Networking WordPress » Problem with attachments after migrating to multisite

  • Resolved marianograndioso

    (@marianograndioso)


    I just migrated my blog into a multisite network. I managed to get mostly everything working, except for post thumbnails. They seem to be unattached, and I can’t figure out which DB record does this. When I go to “Set featured image” screen, I see all the images there and I can set the featured image, but I don’t want to do this manually for each post obviously. The postmeta table is the same as on the old website. They both use the same domain name, so the image paths are still valid.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    How did you import posts?

    I exported the whole database from the old site, opened it in N++, replaced all old db prefixes with [new_prefix]_[blog_number], cleared all the tables that were going to be imported from the new blog and finally imported the old database into the new one.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    *wince* Well that was the hard way ’round. An export/import will keep those attachments for you.

    It should be in wp_x_posts and wp_x_postmeta, provided the IDs all stayed the same.

    They both use the same domain name, so the image paths are still valid.

    Not if this is a subsite. Your image paths are now /wp-content/uploads/sites/#/…

    I just mapped my domain back to the old site, exported all data thru the exporter in tools, remapped to the multisite, imported… and the thumbnails still don’t work.

    The images were indeed in the same path, because that’s where I copied them. There was no ‘sites’ folder yet. So I uploaded a file, let WP create that directory, moved the files from ‘uploads’ to ‘uploads/sites/3’ and changed all records in the DB. Still nothing…

    I did the latter first. Now, after the import, I have duplicate posts. I’m re-importing my database from this morning…

    Any other ideas ? I even tried manually setting the thumbnail to an existing image and it wouldn’t work. The thumbnail code doesn’t seem to output anything.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    How was all this set up originally?

    You have domain1.com which is your multisite, and domain2.com which was a totally separate single site. So you created domain1.com/domain2 (or whatever) on the Multisite.

    Is that right?

    Originally I had the single site/blog on domain 1 (it’s actually nowillnoskill.net). I also have another site – my homepage, which is just simple HTML at myname.com (actually mariancerny.com). I am now building a third site, for which I have domain 3 reserved (cavemanprinciples.com).

    I decided I want to have all the sites under one wordpress installation, so I:
    – installed WordPress with a fresh new DB
    – mapped domain 2 – my homepage to this WP installation
    – created multisite – subdomain style
    – created two new sites
    – mapped domain 1 and domain 3 to the new WP folder
    – copied plug-ins, uploads and the database from the original blog as stated above

    A strange thing is that other images that are just embedded in posts work fine and when I click the add image button, I see all the images. When I click media gallery, I only see blank white images.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    When I click media gallery, I only see blank white images.

    Is allowOverride set to All on your httpd.conf?

    Unfortunately I don’t have access to it…

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Ask your host?

    The problem was that WP didn’t have write permissions to the new upload folder. I changed them to 777 and now I can set featured images. I had to manually update all of them though. Luckily I only have around 30 posts.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Try 755 instead of 777. It’s safer.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Problem with attachments after migrating to multisite’ is closed to new replies.