How did you move the existing site into the Multisite install? There’s a tried and tested way of doing this:
– export existing site (Tools/Export) to a WP export file
– create the new site for it on the MUltisite install
– import the WP export file, making sure to check the box which prompts whether you want to download and import file attachments (i.e. not just images, but all uploaded files referenced by URL in the export file.)
Thread Starter
mayday
(@mayday)
Sorry for the delay. Yes that is what I did. Exported all content with attachments from the original site, then imported all in the new site. The problem is that on my blog page that shows post title, image and excerpt, the thumbnails do not show up here. They do in the individual posts. And if you look in the Media Library there is nothing there.
Exported all content with attachments from the original site
You can’t export all content with attachments using the Tools / Export function. That creates a WP export file, but the uploaded files stay where they are. This makes me wonder if you’ve simply copied over the files, e.g. via FTP, and haven’t used this process.
It’s only when you perform the import from your Multisite site, and check the box to download and import file attachments, that the attachments are brought over. This makes sure that not only are the files copied over, the WP database is properly updated, so the Media Library entries are there.
I suspect the import, without the ‘bring attachments over’ bit doesn’t change the URLs of the images, so they’re still pointing to the old location.
Thread Starter
mayday
(@mayday)
The export of all files worked and the import all worked ok. The problem is that the post’s images are looking in /wp-content/uploads/ instead of /wp-content/files/
This is only happening for the imported posts. New posts and their images are going into the/wp-content/files/year/month#/ and work fine. It is just the older posts.
Is the best fix to do some sql find and replace queries on the db to fix old posts?
Is the best fix to do some sql find and replace queries on the db to fix old posts?
Yes. ONLY search the tables for that site, though. So wp_x_posts.
Thread Starter
mayday
(@mayday)
Yes. I will try this and report back.
Thread Starter
mayday
(@mayday)
This works for the full page for each post (single.php) but not for the category page showing title, image and excerpt. So partly solved the problem.
Thread Starter
mayday
(@mayday)
Interesting, in the Media library it shows those links as unattached yet they are included in the posts.
Uploading images whilst working on a Page (or Post) allows WordPress to create, and store, a direct association between each image and its parent Page (or Post). Just inserting an image into a Page (or Post) does not create any attachment, as far as I know.
Just inserting an image into a Page (or Post) does not create any attachment, as far as I know.
100% correct.
This works for the full page for each post (single.php) but not for the category page showing title, image and excerpt. So partly solved the problem.
Try search/replace on wp_x_postmeta? BACK UP FIRST!