• I have searched the forum but cannot find an answer for a specific issue I am having with images after a move of my blog. I saw a lot of similar issues but no specific answer for my issue.

    Prior to the move my blog was in a directory structure like this: http://mysitename.com/blog (sub-directory)

    I changed the domain name and moved the blog to a new hosting account with the directory structure now http://mysitename.com (root directory)

    I got everything to work except that none of the old images in each post are showing. I checked a single post and the image path was shown as: /blog/wp-content/uploads/cc/imagename.jpg

    When I changed the single post to: /wp-content/uploads/cc/imagename.jpg the image now shows.

    I realize of course that I moved the blog from a sub directory structure to a root directory structure. What I am trying to find out is where can I go to make an all encompassing change that will point all prior posts to the the new structure (/wp-content/uploads/cc/imagename.jpg vs /blog/wp-content/uploads/cc/imagename.jpg) as opposed to having to go through each and every post to change it.

    I already tried going to the Settings/Miscellaneous and putting wp-content/uploads as the path to store images but I realize this is only going to affect new posts and not make a change to the old posts.
    Is there a .php file I can change or something in the MYSQL structure to make this change so it is all encompassing for the old posts?

Viewing 6 replies - 1 through 6 (of 6 total)
  • export a database .sql back up
    do a search and replace with notepad or similar to change url paths
    import database

    always back up 1st

    Thread Starter bradhodges09

    (@bradhodges09)

    Thanks samboll but do I find the .sql backup in MyPhp Admin? I read about doing this somewhere but I did not know where to find that? Sorry I am just not all that familiar with MySQL.

    In phpMyAdmin click on the ‘Export’ tab at the top. On the resulting page, make sure you click the ‘Save as file’ checkbox and then the ‘Go’ button. This will save a copy of your database to your computer. You can then go in notepad and do a find and replace on your URL.

    Thread Starter bradhodges09

    (@bradhodges09)

    Thank you very much for your help!

    Thanks for the info guys. I’ve exported the sql database, made my changes in notepad but how do I go by importing the database back properly? I see the import option but it won’t allow me to import it back since the original copy is still in myphpadmin. Please advise and thanks in advance for the help!

    You are going to want to go back to your existing database structure page, check each of the boxes, next to each of the table and drop them. This will delete all of the tables from your database, and now you can go and import in the new data.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Broken Image Path’ is closed to new replies.