Forum Replies Created

Viewing 15 replies - 241 through 255 (of 257 total)
  • Poco

    (@poco)

    Good idea – I was thinking about keeping the blogger directory structure partially intact /<some id>/<some other id>/<size>/<image>. That would guarantee that the images had unique names so if I found an image with the same name I just wouldn’t copy it again. This could help if someone had the same image linked from multiple posts.

    So I guess I will try to make the system foolproof by making sure it never does the same operation twice rather than trying to make a series of operations atomic.

    Thanks

    Poco

    (@poco)

    Can anyone help me with my plugin?

    The biggest concern so far is that is that if the server times out while running my script it could leave things in a bad state.

    For example, I ran a test and it copied the files from Blogger to my server but timed out before it could copy the thumbnail or update the post. So if I run the script again it will make another copy of that file (carefully using a new name in case the name conflict is valid) and leave the extra jpg.

    How would be the best way to keep track of which posts have been completed and which haven’t? I was hoping to identify a completed post by the fact that it no longer referenced the blogger URL. Basically I really need the “Copy image, copy thumbnail, update post” to be atomic and correctly handle being terminated part way through.

    Thoughts?

    Poco

    (@poco)

    The first step in a blogger import is to make a backup of your blogger template. I know that doesn’t help your situation, but don’t blame the WordPress team for your mistake.

    The WordPress themes are not compatible with the blogger templates. The two systems are actually quite different – Blogger uses the template to format the html when you publish the content and WordPress uses the theme to format it when you view the content.

    Any hacks you make to your blogger template cannot be imported to WordPress.

    The whole point of switching to WordPress from Blogger is if you feel there is something WordPress will provide that Blogger doesn’t. If you are happy with Blogger then why switch at all?

    If there are specific Blogger hacks that you have applied you can probably get some help here finding similar WordPress plugins. Yelling about it isn’t going to get you any help. Asking relevant questions will.

    This sounds simple enough. I am fairly new at this but let me give it a shot.

    With WP 2.0.x you can import your blogger blog entries to your WP blog using the import tool in the admin interface. When it works it is pretty easy to use and it imports all posts and comments (but not images, but I’m working on a plugin for that https://www.ads-software.com/support/topic/59966). Be warned that most of the documentation on this site about imports refers the WP 1.5 and is no longer applicable with the import feature. Be sure to backup your blogger template and important settings before you start. If you have problems there are some posts here that might help.

    I’m not sure about b. but you could install your WP files to the root of you site and add an entry in your .htaccess to remap news.html to the root folder or index.php. That would at least get the root working. I am guessing that you could also setup the permalinks to make the old post URLs continue to work as well. Someone else may be able to comment on that.

    Well, I have some tests working right now. I haven’t run it on my entire blog yet, but it works on single posts.

    Quick Poll:

    1. My script currently creates an image post for the images and makes that a child of the main post before linking the images (just like the image upload feature). I also have the option of turning this off. Can anyone think of a good reason to make a post for the image? I can’t even figure out how to access it without inserting a link to it in the post itself (through the image browser) and even then it is just a post with a link to the image. I am tempted to disable this for the imports since they aren’t really useful and I am not likely to want to browse them later.

    2. The script can take a while and my server times out if they take too long (I suppose I could increase the timeout on the server, but not everyone has this option). What is the best way to handle this? It would suck if the script got halfway through a post and didn’t complete because of the delay (copied the image but didn’t setup the links). I am thinking about just doing a fixed number of images at a time. This makes the whole process a little less automated unless I have the page automatically refresh if it did not complete (how?). I could also set a time limit and calculate running time (how?) so that each attempt takes no longer than 30 seconds. Any thoughts?

    3. What about the location of the images? Currently my script uses the same code as a normal image upload and inserts them into wp-content/uploads/<year>/<month> with the current date. This means that all blogger images will end up in one folder with the date of import. I was thinking about making it use similar paths to the original blogger posts or putting them all in a wp-content/uploads/blogger to identify them better. Again, any thoughts on this?

    I will publish my script as soon as I have worked out the time issues and done some more tests. I don’t want to release this prematurely and have it break someones blog.

    I couldn’t find anything already done, so I have decided to write my own plugin to do this. This may take me a while. I am learning about PHP and WP plugins while I do it.

    I currently have a plugin that adds itself as an Options tab in the admin interface that, when run, outputs the URL of every jpg in my blog that is hosted by blogger. Hey, it’s a start.

    I think with some mystical use of wp_insert_attachment, add_post_meta, update_post_meta (All used by inline-uploading.php) and a variation of wp_handle_upload that retrieve the file from a URL, that I might be able to get this going.

    I want it to produce exactly the same results as if I had manually added them in the upload interface. Each image will get its own post and instead of creating a thumbnail I will simply reuse the one on blogger.

    I will release it when I am done if anyone wants it. The more interest there is the faster I am likely to complete it.

    What if you were to backup the wp_options table, reset the DB, do a quick install (click, click, click) and then restore that options table? I’m still new to WP so my advice should be taken with caution ??

    I don’t know about the title thing. Most of my blogger blog had titles, it was just some really old posts that didn’t. I know that blogger effectively used the first few words as the title but I haven’t been using WP long enough to be much help. I wonder if it could be done with a plugin (if title looks like ID replace with first few words of post).

    My problems with the images is that they are all hosted on blogger.com. I have been asking around for information on this but no one seems to know, so I have decided to write a plugin that goes through each post, downloads the images, and updates the links. If you know a better way to do this I am all ears. I would be happy if someone could help me find a plugin that was similar enough to modify (anything that parses through each post of the blog and does something, I can figure out the rest).

    I see the same thing on some of my posts, but fortunately it only affects a few older items. I wouldn’t mind knowing how to resolve this automatically too. Sorry I can’t help, I’m still trying to write a plugin to copy the images from my blogger blog.

    However, I can answer 3. If you delete all the WP tables from your database (but keep the database) that will reset your blog and require you to go through the wp-install.php process again.

    You should try EasyPHP.

    Last night I downloaded EasyPHP, installed it, ran it, enable the curl extensions through their configuration GUI and had a WP host setup in a few minutes. Probably less than twenty mouse clicks to have the running and server up with the appropriate extensions. It was more work to install WordPress on the server after it was running.

    Thread Starter Poco

    (@poco)

    So far so good.

    I installed EasyPHP
    I installed WP (I copied the files from my live server, but I doubt that was an improvement except that I can try and edit my theme).
    I imported my blogger blog. It failed the first time I tried, but I clicked on import, and selected the blog again (75% done), and it continued without issue.
    Now I have my blog on my local server. It all looks good. Everything is there. The formatting is a bit different on some of my more obscure entries, but that I can fix.

    I have not yet copied the DB back to my main blog. I don’t want to copy it until I figure out an easy way to convert the photos and links from blogger to my domain (I suspect that I can automate this with some php, but I’m still new to php).

    If anyone has any suggestions about how I might automate the process of downloading any embedded jpgs hosted on blogger.com, save them on my server, and fix the links, that would be great.

    I’ve started a new thread https://www.ads-software.com/support/topic/60220?replies=3 regarding installing a local version of WP to do the blogger import and then copy my DB. I am mid process, but so far so good.

    Thread Starter Poco

    (@poco)

    Thanks, I will give it a try. This is only a one time thing (for now) just so that I can import from blogger successfully. I will copy everything minus wp_options from my live blog to my local blog, import from blogger, then copy those tables above back to my live blog (after the appropriate amount of backing up).

    Thanks for the help, I will report back how it goes for those who are considering the same thing.

    I got an idea from another thread. I’m going to setup an Apache+php+MySQL server on my PC and try importing my blogger blog to that. This way I have full control over the server and software that could be causing problems.

    If that works then I assume there is a way to export the DB and import it to my live server.

    Can anyone who has done a flawless blogger import recommend a server combo (prefereably one of those all-in-one downloads) that should work?

    I keep asking about this, but it seems like it should be possible for someone who is smarter than me to write some php script to fix the image links from a blogger import.

    Parse the WP DB, look for any .jpg files hosted on blogger.com, download them into a directory, and update the links. Anyone want to give it a try?

    I’ve heard rumours that there is a tool to help with this process. If anyone know any more that would be helpful since I have a lot of photos hosted on my blogger blog. Once I figure out how to get the import working (that is an entirely different problem) I will need this myself.

    It seems like it should be simple enough to do. Scan through the blog entries looking for .jpg files hosted at blogger.com, download those files (you can download them with no referrer – not embedded in a web page) to a directory in the wordpress blog and update the links. I have no idea how to do it, but someone who knows wordpress and the wordpress DB should be able to write this in no time. Anyone?

Viewing 15 replies - 241 through 255 (of 257 total)