-
-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imported entities not displaying #734
Comments
It looks like apart from the Should I manually create these two entries for each entity I import? Or would it be better to import both the entities and the metadata tables? |
Should I try to write a PHP script that extracts the JSON data from the entities table and converts it to entries in the metadata table for the missing |
@benwerd I got quite far with this, but now I'm still stuck. I worked out I need to create at least the following metadata records for each entity: access: 'PUBLIC' It's now already displaying the 'Older' button on the front page, so the page is aware that the imported posts exist, but it's still not displaying the imported posts themselves. Which fields am I missing? Is there an easier way to make this work? |
Ah, I found the problem. What's needed is:
Looks like for the imported Status entities, not only the metadata, but also the accompanying Activity entity is missing and /its/ metadata are missing. |
OK, I ended up using a variety of methods :) First in bash: Then in vim:
Then in nodejs: var entities = require('fs').readFileSync('metadata.txt').toString().split('\n');
for (var i=1; i<entities.length; i++) { // skip the first line because it's the header of the mysql output
if (entities[i].length) {
var obj = JSON.parse(entities[i]);
for (var key in obj) {
console.log('INSERT INTO `metadata` (`entity`, `collection`, `name`, `value`) VALUES ("'
+ obj.uuid + '", "'
+ 'entities' + '", "'
+ key + '", "'
+ obj[key] + '");');
}
}
} (save that as generateMetadata.js and then run that as This seems to at least generate all the necessary metadata entries. |
Do also take care to also run @pierreozoux @timmmmyboy you may find these commands helpful when doing an import from a customer who came from *.withknown.com or elsewhere. Have you done any successful migrations yet? I just completed my first and second one! :) |
Thanks @michielbdejong! Haven't had anyone need a migration of Known yet but this thread will be very useful when that time comes. |
Yes, thanks! No people yet, but yeah, it will be really helpful! |
Thanks @michielbdejong for this. I'm running into the same issue trying to import my earlier posts from a hosted davidmead.withknown.com to self-hosted blog.davidjohnmead.com. The entities.sql imported fine and merged with my current posts. But apart from that, nothing. Now I see there's a number of hoops I have to jump through to get it working :-( Where did you place the folders from your old Known blog? Under 'Uploads' in a new sub-folder, or did you merge them with the current folder in there? |
@davidmead yeah, importing the static uploads files was the easy part in my case, that worked as expected for me. Just merge uploads with uploads, and run |
Guys, I've just come back to see this thread, and I apologize for the SQL omission. We'll fix that - you definitely shouldn't need to write a script to import / export! I meantioned to @davidmead on Twitter that we're working on an easier mechanism. I think this is crucial. Really nobody should have to muck around with SQL, either. |
@benwerd++ \o/ |
Here's how I want it to work:
All thoughts on this appreciated. |
Yeah turns out I now have one of these on my plate too and wasn't looking forward to having to do some fancy scripting in Node :). A SQL file would be fine for now, more than used to that and we can do a find/replace on links. @benwerd being able to import from an existing install would be awesome! I don't know how well that deals with mapped domains though where the old site and new site might be at the same URL as part of a migration. That can happen if someone is moving to or from Withknown.com and taking their domain with them. |
Yeah, it wouldn't work in that case. If you have access to the entities and metadata tables, @timmmmyboy, you can just move them across. Otherwise, I'll try and take a peek at the export format later today. |
Thanks @michielbdejong, but I when I read
you've lost me. Last time I "knew" what to do with a command line was with my ZX Spectrum ;-) But there's guys I work with who can help me with that. I've grabbed your post into Evernote and may try it later this week. I'll ping you if it goes horribly wrong. |
@benwerd I think that's exactly how I'd expect it to work. As a user I shouldn't have to see or do anything with the wiring behind the boards, so to speak. It should be stated that only other Known sites can be imported this way, unless you're planning on doing that for WP too (fingers crossed. I have one of those too). Export should a separate page/tab and it should be clear what you'll get from that. |
Also @benwerd, we have to think about how it'll notify search engines that content has moved from one blog to another. After importing, would you offer closing down the *.withknown.com site? If so could you automatically implement a 302 redirect in an .htaccess somewhere? |
cool idea! Also relevant for people who migrate to KnownPro, probably. |
@davidmead about wordpress, FYI you can follow conversation here. |
Thanks for the link @pierreozoux |
@davidmead Actually, I suggested this the earlier today (https://mapkyca.com/2015/benwerd-withknown-they-should-get-an-option-to-set-everything) in response to a complain about the blogger export. Definitely wise to present the option, although I would suggest that you use a 301 rather than a 302, so that search engines update themselves. |
This issue is no longer relevant, because now when you click '(re-)generate my archive' and then download it, the 'exported_data' file inside the zip is a .sql file containing both the entities and the metadata. |
First of all, thanks for creating the export format with the entities.sql file, that's a great step!
I imported the entities table for a customer, but the imported posts are not displaying. I updated their URLs and owner URLs using search-and-replace (I had to do an import-and-dump first to get the hexadecimal blobs to turn into text which I can search-and-replace in with a text editor), but that was not helping. I analyzed the MySQL queries, and found out that it is trying to go to metadata for the
access: 'PUBLIC'
part. Looking at the code, maybe I should just create one entry in the metadata table for each imported entity?The text was updated successfully, but these errors were encountered: