Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I don't have access to my old blog any more. However, I do have all the files (wordpress export and uploads folder). Now... I'm trying to import all that stuff in my new blog and unfortunately I can't upload my media files. There is an option to "import and download" but it tries to download files from my old server (not available any more).

Is there a way I can redirect "importer" to get files from my local computer as opposed to old web site?

Please help!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You'll need to open the xml file and manuall do a search and replace for the old URL and replace it with the new URL (It sounds like you're using the import plug-in, if not you'd open the SQL DB File to make the changes).

You can use NotePad++ for a simple search and replace. Since the images aren't on your older server, you'll need to place then on the new server and amend the search and replace "replace" value with the new URL. You'll need to be sure to catch all "Hard Coded" URL's EXAMPLE:

Search:

http://youroldwebsite.com/wp-content/uploads/2011/09/

Replace:

http://yournewsite.com/wp-content/uploads/2011/09/

You would just need to be sure that you replace all image dates (Month/Year) to reflect the actual folder you put them in. In my example every image that was hard coded would need to be replaced to trick WP into thinking they were all uploaded on 2011/09, which is what you'd have to name the folders for it to work. The search should also catch the post meta since you won't be uploading the DB or will you? If so, you'll need to update that as well.

Not completely effortless, but it might be better than manually replacing them depending on the amount of images you have.

share|improve this answer
    
Yeah... but... will media files be attached to posts? I agree links will work.. but there will be no association between post and media. For example, if I edit my post and click on media icon, I won't see existing uploads under gallery link.. that's what's worrying me. –  user3047 Oct 2 '11 at 20:54
    
If you follow my instruction it should work. I've used the importer before and it did add the media icons in the media section of the admin panel. The key is to upload the images to the directory, and then change the image locations in your xml file. It should work as expected if you follow the instructions correctly. –  Jeremy Jared Oct 3 '11 at 0:57
    
I did it. I copied uploads folder from my backup onto my new server. Then changed the links with text editor (find and replace) to look for files on my new server. Then I imported using importer and clicked import & download. It worked... it took some time as it had to upload/download files through wordpress... but it worked –  user3047 Oct 3 '11 at 20:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.