Hi banjohead,
I’ve attempted to reproduce this myself — by moving a site to a new domain, updating the home
and siteurl
wp_option
s, and then seeing what happened to my slides.
Do your slides still show up in the Slider admin interface, where you edit them, or when they ‘disappear’ are they gone from both the frontend and backend?
My slides still show up — the only thing that breaks and requires a find/replace to update the paths is the background images. However, if I simply find/replace the old URL for the new URL on the total_slider_[slidegroup]
wp_option
, though, I’ll likely break the formatting of the PHP serialised data.
Permit me to dive into a little technical detail here:
The slide itself is a PHP array, which has been serialize()
d. If ou look at the raw database, you might notice how the serialisation stores different variables — they have a single character prefix (‘s’ for string, ‘i’ for integer, ‘a’ for array, etc.). In the case of strings, you’ll see a number after that character prefix, s:82
. That number is the string length.
If you do a find replace on the background URL string, the length of the string is likely to change. However, if you fail to also update the string length in that prefix at the same time, the whole serialised string will be corrupt, and PHP will refuse to unserialise it.
If I’m guessing the issue correctly, you should be able to fix this by looking through each of your total_slider_[slidegroup]
wp_option
s, and recalculating the length of any strings that you changed, fixing those string length prefixes.
For example, let’s say this was the original background
entry in the wp_option
:
s:65:"https://www.old-domain.com/wp-content/uploads/2012/07/picture.jpg"
If you swap www.old-domain.com
for www.shiny-new-domain.com
, it’ll look like this:
s:65:"https://www.shiny-new-domain.com/wp-content/uploads/2012/07/picture.jpg"
However, the string is no longer 65 characters long. We must recalculate its length, 71 characters, and update the prefix:
s:71:"https://www.shiny-new-domain.com/wp-content/uploads/2012/07/picture.jpg"
Does that make sense?
Let me know how you get on with this. If you need any support with making these database changes, I’m sure we can help.
This highlights an important issue with migrating sites, which is something I can look into making better in future Total Slider versions, so thanks!
Peter Upfold
Total Slider Developer