I had a couple of websites running different wordpress versions for a while, but it was turning a bit hard.
So I did some research and tried migrating one website to a fresh 3.5.1 MU install using domain mapping.
The issue now, it’s that the “attachment” system it’s not working and thing like gallery or
get_the_post_thumbnail()functions aren’t working either. Also even when I can see the images on the “media library” when trying to pick a featured image nothing happens, the blue button stays there, instead showing the thumbnail.
I basically did this:
1. Exported the database through sql
2. Check which id my new site had (2)
3. Search and replace with a text editor
4. Import the tables into the database
5. As the “Changing Site Url” codex article said, I changed the url for the uploads
I found the previously described problem, and then I tried to change the “guid” (also, as the article pointed out).
I’m really lost right now, because direct links works, and the galleries for example I can only see the links pointing to the new location, clicking the link actually shows the image.
Any clue on what could be happening?
Yeaaah, that wasn’t the right way to do it.
The RIGHT way is to actually use WordPress’s built in export/import tool. Any chance you can undo what you did and start over? It’s really a hassle to try what you did, because the upload path moves, but that’s not the only thing.
In my experience the export/import tool works, but when it’s not too much. It’s quite common to get php timeouts, problems moving the images, etc.
Anyway, I should point that I partially solved the problem:
It was a bad idea rename
new_2_because there are some values that are supposed to be called
wp_! Like the ones inside the
postmetatable, specifically under the
meta_keycolumn. After that magically every attachment works :).
TL; DR → just rename the table names, not everyhing inside as I did.
It’s quite common to get php timeouts, problems moving the images, etc.
Depends on the size of the site (and the memory on the server). You can always break it out into categories or tags.
You may still have other issues with what you did, and if so, let us know!
You are right :D, I ran into some other issues like breaking user roles. That’s because the roles are serialized inside the
wp_optionstable. So at least the values of that table has to be changed too.
Since plugins doesn’t have a way to call or write inside the database, it could change between plugins, but I honestly doesn’t care a lot about that. In the end, most issues about their configuration could be caused by that, using
Until now, I have migrated two websites, and I’ve been able to keep the content and the users (even keeping their old passwords).
The only problem I’m running now, it’s that I don’t know how to keep the “ownership” of the posts, but I guess I need a little bit of research, if you have any clue I’ll be glad to know 🙂
Sorry, can’t edit the old post.
Well, it wasn’t hard actually… just needed to map the new ids for the
new_prefix_userstable with the old ones. In case someone else run into it, it’s solved by a simple sql statement (make sure your are in the right database):
UPDATE table_name SET post_author = REPLACE ( post_author, 'old-id', 'new-id');
idis a numeric value.
- The topic ‘Attachments doesn't work going to single to multisite’ is closed to new replies.