Meigo62
Meigo62

Reputation: 183

Importing WP posts to WAMP localhost

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.

Upvotes: 0

Views: 394

Answers (3)

bdombro
bdombro

Reputation: 1421

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:

Upvotes: 0

Marcin Bobowski
Marcin Bobowski

Reputation: 1765

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.

Upvotes: 1

Hobo
Hobo

Reputation: 7611

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.

Upvotes: 0

Related Questions