0

I´m trying to import all my posts including postmeta to my WAMP localhost for website management. There are around 400 posts including pictures of 3 years.

I imported following tables: wp_posts and wp_postmeta.

Posts work fine as I expected but pictures (featured images and inside post images) won´t appear. I ran a SQL query from phpmyadmin. The query is following:

UPDATE wp_posts SET post_content = REPLACE(post_content, 'throwholics.com', 'localhost');# Mõjutati 19 rida. 

UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'throwholics.com', 'localhost');# MySQL tagastas tühja tulemuse (s.t nulliread). 

UPDATE wp_options SET option_value = REPLACE(option_value, 'throwholics.com', 'localhost');# MySQL tagastas tühja tulemuse (s.t nulliread).

I also tries Velvet Blues URL update plugin and now I can´t even enter full posts after I changed from old domain http://www.throwholics.com to http://localhost

It did not work. Does anyone have a clue how to fix this? I´m running out thoughts here. Would appreciate your help. Thanks.

3 Answers 3

1

My way of doing that that works.

  1. Make a dump of oryginal sites database (phpMyAdmin)
  2. Use a good html/php/css/sql editor and replace each http://olddomain.com witch

    "http://127.0.0.1"

  3. Load modified database to mamp.

  4. Remember to copy .htaccess if You use perettylinks.
0

Use the Search and Replace for WordPress Databases Script mentioned in the Moving WordPress page of the codex. It'll take care of serialised PHP structures, which is probably what's breaking with your updates.

1
  • I used it and changed throwholics.com to 127.0.0.1 , 1 picture appeared but links still don´t work... maybe I´m just not much of a sql guy :D
    – Meigo62
    Jan 9, 2013 at 22:09
0

In addition to updating your db, you will also need to manually copy the pictures to your localhost to the correct folder and with the correct permissions

  1. Copy the files Using an ftp client or scp or rsync:

    copy remote_host/wp_root_path/wp-content/uploads to localhost/wp_root_path/wp-content/

  2. Set permissions

    sudo chmod -R 755

    sudo chown apache

Here are some addition resources which might be helpful to you:

2
  • Did you set the proper permissions? Sorry I didn't add that until just now
    – bdombro
    Jan 9, 2013 at 22:16
  • as I´m running in localhost I changed all permissions to full control.
    – Meigo62
    Jan 9, 2013 at 22:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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