Reputation: 183
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
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
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/
Set permissions
sudo chmod -R 755
sudo chown apache
Here are some addition resources which might be helpful to you:
Upvotes: 0
Reputation: 1765
My way of doing that that works.
Use a good html/php/css/sql editor and replace each http://olddomain.com witch
"http://127.0.0.1"
Load modified database to mamp.
Upvotes: 1
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