Often times during site migrations you may need to do bulk updates to links or other content to many pages at once. Using phpmyadmin is a great way to accomplish this.
A general snippet would be:
UPDATE wp_posts SET post_content = REPLACE(post_content, 'whatyouhave', 'whatyouwant')
UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://', 'https://')
Would update all http links to https links
UPDATE wp_posts SET post_content = REPLACE(post_content, '/subdomain/sub2/', '/newdomain/new2/')
Would update urls from one path to another.
During a recent migration from a hosted ecommerce solution to woocommerce we had to move a large number of product images. With a combination of the woocommerce csv export and csv import modules moving large numbers of products is quite easy. That’s for the data.
For the graphics you cannot just upload graphics into the wordpress media library and have them immediately recognized so you need to do a few things first.
- Using your sftp program – upload your image files to /wp-content/uploads/subdirectory
- Install and activate the “Add From Server” plugin
- Go to ->media->add from server and navigate to your “subdirectory” that has your uploaded images
- Then select all the images and click “import”
Then all of your images will be uploaded to the “uploads/subdirectory” directory.
That’s not all, however, if you are using these images in woocommerce products. You then need to regenerate the thumbnails so…
- Install and activate the “Regenerate Thumbnails” plugin
- Go to ->tools->Regen. Thumbnails and click to regenerate the thumbnails.
At this point all your images are ready to use.