Missing product URL after moving to live environment from local
-
I want to keep this simple. When I shift my local version of the website to my live server. I run the following MySql command to update all the wordpress links, options, meta etc.
Local -> Live UPDATE wp_options SET option_value = REPLACE(option_value, 'https://local.photos.simonilett.com', 'https://photos.simonilett.com') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_posts SET guid = REPLACE(guid, 'https://local.photos.simonilett.com','https://photos.simonilett.com'); UPDATE wp_posts SET post_content = REPLACE(post_content, 'https://local.photos.simonilett.com', 'https://photos.simonilett.com'); UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'https://local.photos.simonilett.com', 'https://photos.simonilett.com');
My shop uses simple, ‘virtual’, ‘downloadable’ products only, images in this case. Uploaded via the WordPress media gallery.
When I copy my database up to the live server and run the MySql above, it removes ALL downloadable file URL’s & names of WooCommerce products. Setting them all to blank when you view a product in WordPress.
For example
File Name on local :: Click Here To Download Image
File URL on local :: https://local.photos.simonilett.com/wp-content/uploads/2016/08/filename.jpgBecomes
File Name on local :: (empty)
File URL on live :: (empty)I have even checked through post_meta and it is updating correctly in the database, the post_meta options look like this on the live database
a:1:{s:32:”7000dd68380f8a3030b3baa7a9beb077″;a:2:{s:4:”name”;s:33:”Click here to download your image”;s:4:”file”;s:76:”https://photos.simonilett.com/wp-content/uploads/2016/08/filename.jpg”;}}
Notice correct URL,
WHY, won’t the product URL’s show up in the product pages after running that command.
PS : If I don’t run the post_meta update, I also don’t get any URL’s present while editing a product. I’d honestly expect to at least see the incorrect URL of ‘https://local.photos.simonilett.com/wp-content/uploads/2016/08/filename.jpg’
- The topic ‘Missing product URL after moving to live environment from local’ is closed to new replies.