logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$10
text widget not saved

I have a wp multisite with several sites.
Each site have many widgets.

The version of this wp is 3.0.1
i upgraded wordpress to wp3.2.1
all is ok
BUT all my text widgets are disappeared.

Only the text widgets. The others are here, but the text widget are disappeared.

this is a mysterious mystery, isn't it.

Sébastien | French WordpressDesigner | 12/19/11 at 6:14pm Edit
Tutorial: How to assign prize money

Previous versions of this question: 12/19/11 at 6:15pm

(4) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    12/19/11
    6:43pm
    Eli Scheetz says:

    What troubleshooting steps have you tried?

    Can you add the text widget again?

    is the widget in the lower section of the page called "Inactive Widgets"?

    is it still saved in the database?
    SELECT * FROM wp_options WHERE option_name LIKE 'widget_text'

    • 12/20/11 6:26am

      Sébastien | French WordpressDesigner says:

      Ok... i verified : the problem is :
      i change the url of the domain in the db
      but i must not change this url in widget_text

      How can i replace the url every where but not in widget_text
      Is that possible in phpmyadmin ?

  • avatar
    Last edited:
    12/19/11
    11:35pm
    Arnav Joy says:


    try following links

    http://wpmodder.com/how-to-change-your-wordpress-theme-without-losing-your-widgets-or-your-composure-525.html

    http://premium.wpmudev.org/forums/topic/moved-to-new-subdomain-lost-text-widgets-and-custom-header-images

    http://shibashake.com/wordpress-theme/move-an-existing-blog-into-wordpress-multi-site

    • 12/20/11 6:27am

      Sébastien | French WordpressDesigner says:

      Ok... i verified : the problem is :
      i change the url of the domain in the db
      but i must not change this url in widget_text

      How can i replace the url every where but not in widget_text
      Is that possible in phpmyadmin ?

    • 12/20/11 6:31am

      Arnav Joy says:

      SO YOU WANT SAME VALUE FOR widget_text FIELD IN THE wp_options table after moving your site to different domain.??

    • 12/20/11 6:50am

      Sébastien | French WordpressDesigner says:

      yes that's it.
      The value don't change.
      After and before moving, the value is the same.

      unless you know change the value without breaking this kind f code

      INSERT INTO `wpavignon_options` VALUES (90, 0, 'widget_text', 'a:36:{i:2;a:0:{}i:4;a:3:{s:5:"title";s:22:"Casque auditif Avignon";s:4:"text";s:365:"<a href="http://www.villedavignon.fr/category/protection-auditive-avignon/casques-anti-bruits-protection-auditive-avignon" style="display:block;width:239px;height:430px;margin:0 auto;text-indent:-9999px;outline:0;background:url(http://www.villedavignon.fr/wp-content/uploads/2011/03/totem2010BD3.jpg) 0 0 no-repeat">Audioprothésiste Avignon</a>";s:6:"filter";b:0;}i:7;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:505:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre</a><br /></dd></dl></div>";s:6:"filter";b:0;}i:8;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:9;a:3:{s:5:"title";s:4:"Plan";s:4:"text";s:857:" <iframe width="237" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.fr/maps?f=q&amp;source=s_q&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small>\n        <a href="http://maps.google.fr/maps?f=q&amp;source=embed&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">Agrandir le plan</a></small>     ";s:6:"filter";b:0;}i:10;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:11;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:12;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:13;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:14;a:3:{s:5:"title";s:25:"Audioprothésiste Avignon";s:4:"text";s:329:"<a href="http://www.villedavignon.fr/centre/ville-conseil-avignon" style="display:block;width:239px;height:795px;margin:0 auto;text-indent:-9999px;outline:0;background:url(http://www.villedavignon.fr/wp-content/uploads/2010/09/totem2010BD2.jpg) 0 0 no-repeat">Audioprothésiste ville conseil Avignon</a>";s:6:"filter";b:0;}i:15;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:16;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:17;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:18;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:19;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:20;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:21;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:22;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:23;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:24;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:25;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:26;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:27;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:28;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:29;a:3:{s:5:"title";s:4:"Plan";s:4:"text";s:857:" <iframe width="237" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.fr/maps?f=q&amp;source=s_q&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small>\n        <a href="http://maps.google.fr/maps?f=q&amp;source=embed&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">Agrandir le plan</a></small>     ";s:6:"filter";b:0;}i:30;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:31;a:3:{s:5:"title";s:4:"Plan";s:4:"text";s:857:" <iframe width="237" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.fr/maps?f=q&amp;source=s_q&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small>\n        <a href="http://maps.google.fr/maps?f=q&amp;source=embed&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">Agrandir le plan</a></small>     ";s:6:"filter";b:0;}i:33;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:34;a:3:{s:5:"title";s:23:"Présentation du centre";s:4:"text";s:518:"<div class="attachments"><dl class="attachments attachments-medium"><dt class="icon"><a title="Présentation centre" href="?aid=599&pid=57&sa=0"><img src="http://www.villedavignon.fr/wp-content/plugins/eg-attachments/images/pdf.png" width="32" height="32" alt="" /></a></dt><dd class="caption">Fichier: <a href="http://www.villedavignon.fr/wp-content/uploads/2010/04/Présentation-centre.pdf" title="Présentation centre">Présentation-centre.pdf</a> (262 Ko)<br /></dd></dl></div>";s:6:"filter";b:0;}i:35;a:3:{s:5:"title";s:4:"Plan";s:4:"text";s:857:" <iframe width="237" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.fr/maps?f=q&amp;source=s_q&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small>\n        <a href="http://maps.google.fr/maps?f=q&amp;source=embed&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">Agrandir le plan</a></small>     ";s:6:"filter";b:0;}i:36;a:3:{s:5:"title";s:4:"Plan";s:4:"text";s:857:" <iframe width="237" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.fr/maps?f=q&amp;source=s_q&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small>\n        <a href="http://maps.google.fr/maps?f=q&amp;source=embed&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">Agrandir le plan</a></small>     ";s:6:"filter";b:0;}i:37;a:3:{s:5:"title";s:4:"Plan";s:4:"text";s:857:" <iframe width="237" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.fr/maps?f=q&amp;source=s_q&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small>\n        <a href="http://maps.google.fr/maps?f=q&amp;source=embed&amp;hl=fr&amp;geocode=&amp;q=ville+Conseil+Avignon&amp;sll=44.028371,4.751587&amp;sspn=2.255115,5.817261&amp;ie=UTF8&amp;hq=ville+Conseil+Avignon&amp;hnear=&amp;cid=15385383812017756807&amp;ll=43.946608,4.842997&amp;spn=0.018539,0.025749&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">Agrandir le plan</a></small>     ";s:6:"filter";b:0;}i:38;a:3:{s:5:"title";s:4:"Test";s:4:"text";s:332:"<a href="http://www.villedavignon.fr/category/appareils-auditifs-avignon" style="display:block;width:237px;height:748px;margin:0 auto;text-indent:-9999px;outline:0;background:url(http://www.villedavignon.fr/wp-content/uploads/2010/09/totem2010BD2.jpg) 0 0 no-repeat">Audioprothesiste ville Conseil Avignon</a>";s:6:"filter";b:0;}i:39;a:3:{s:5:"title";s:26:"Téléphone 04-05-06-07-08";s:4:"text";s:0:"";s:6:"filter";b:0;}i:40;a:3:{s:5:"title";s:28:"Accessoires auditifs Avignon";s:4:"text";s:316:"<a href="http://www.villedavignon.fr/category/accessoires-auditifs-avignon" style="display:block;width:239px;height:440px;margin:0 auto;text-indent:-9999px;outline:0;background:url(http://www.villedavignon.fr/wp-content/uploads/2011/03/totem2010BD.jpg) 0 0 no-repeat">ville conseil Avignon</a>";s:6:"filter";b:0;}s:12:"_multiwidget";i:1;}', 'yes'); 
      .

    • 12/20/11 6:53am

      Arnav Joy says:

      in your old database find the value of widget_text in wp_options table using phpmyadmin

      then copy this value

      and in new domain again find this value in wp_options table then paste this value.

      i think you are having your old db.

    • 12/20/11 6:57am

      Sébastien | French WordpressDesigner says:

      ok but i have 100 sites in my wpmulti
      if i use your method, i must cpy/paste 100 times ??

    • 12/20/11 7:09am

      Arnav Joy says:

      see this url may be this can help you

      http://wpsmith.net/tag/update_option/

    • 12/20/11 7:13am

      Sébastien | French WordpressDesigner says:

      good link. Could you write for me the function i need please ?

    • 12/20/11 7:20am

      Arnav Joy says:

      http://codex.wordpress.org/WPMU_Functions/update_site_option

    • 12/20/11 7:28am

      Arnav Joy says:

      copy the value of widget_text from the old db and then use following code

      $key = 'widget_text';
      $value = 'paste here value some thing like this {a:4:{i:2;a:0:{}i:3;a:3:{;}}' ;

      then use this function

      <?php update_site_option($key, $value); ?>

      Note:- Please take proper backups of your db.

    • 12/20/11 7:52am

      Sébastien | French WordpressDesigner says:

      euh... with this method, i can update just one site at a time.
      That is not what i want.
      I need a method to update all my sites in one time.

    • 12/20/11 8:31am

      Arnav Joy says:

      define this in functions.php

      function update_ms_option($blogID, $option_name, $option_value) {
      global $wpdb;

      $wpdb->query( $wpdb->prepare( "
      INSERT INTO `".DB_NAME."`.`".$wpdb->get_blog_prefix($blogID)."options`
      (
      `option_id` ,
      `blog_id` ,
      `option_name` ,
      `option_value` ,
      `autoload`
      )
      VALUES (NULL, '0', '%s', '%s', 'yes')
      ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = '%s', `autoload` = VALUES(`autoload`)",
      array($option_name, $option_value, $option_value) ) );





      call this function no. of times as your no. of sites

      $numOfMultiSite = 100; // replace this value as per your sites
      $option_name = 'widget_text';
      $value = 'your value of widget_text' ;

      for( $i = 1; $i <= $numOfMultiSite; $i++ ) {

      update_ms_option($i, $option_name , $value);

      }


      Note : Please take full back of everything before doing this.

  • avatar
    Last edited:
    12/20/11
    3:46am
    Francisco Javier Carazo Gil says:

    Hi Sébastien,

    Have you got the dump from old installation? If you have it look for "widget_text" in the file. It should be placed in "wp_options" as Eli says.

    After that, you can go to your database, and UPDATE the content of the "widget_text" saved, for the new one.

    Test if some widgets depends of a plugin that have not been updated.

    If you haven't saved the dump, go to DB as Eli says and look for this cell. It should be something like this:

    a:4:{i:2;a:0:{}i:3;a:3:{s:5:"title";s:22:"Envíanos tu artículo";s:4:"text";s:256:"Sin necesidad de estar registrado como <a title="Autores en RDA" href="http://www.reddeautores.com/autor">autor</a> puedes enviarnos tu artículo. Empieza <a title="Env&iacute;a tu art&iacute;culo" href="http://www.reddeautores.com/enviar">aqu&iacute;</a>.";s:6:"filter";b:0;}i:4;a:3:{s:5:"title";s:22:"Suscríbete por correo";s:4:"text";s:563:"<form style="border:1px solid #ccc;padding:3px;text-align:center;" action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=reddeautores', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true"><p>Introduzca su dirección de correo:</p><p><input type="text" style="width:140px" name="email"/></p><input type="hidden" value="reddeautores" name="uri"/><input type="hidden" name="loc" value="en_US"/><input type="submit" value="Suscribirse" /></form>";s:6:"filter";b:0;}s:12:"_multiwidget";i:1;}

    • 12/20/11 6:27am

      Sébastien | French WordpressDesigner says:

      Ok... i verified : the problem is :
      i change the url of the domain in the db
      but i must not change this url in widget_text

      How can i replace the url every where but not in widget_text
      Is that possible in phpmyadmin ?

    • 12/20/11 6:38am

      Francisco Javier Carazo Gil says:

      Sébastien,

      I recommend you the next one:
      1. Do a dump of your DB
      2. Delete all your DB
      3. In the sql file, do a "Find and replace" with the old and the new url.
      4. Import to your DB your sql modified

      For me this is the simplest way to achieve it. You can also work with UPDATE and "%" but for me is less comfortable.

    • 12/20/11 6:55am

      Sébastien | French WordpressDesigner says:

      If i do that, the url will be replaced everywhere in my db...
      i can't replace the url one to one. The url appears 5500 times in the db

    • 12/20/11 7:24am

      Francisco Javier Carazo Gil says:

      Sébastien,

      In Notepad++, Geany or any other powerful code editor, you can do a: "Replace all".

    • 12/20/11 7:54am

      Sébastien | French WordpressDesigner says:

      lol... :-) I know.

      But if i replace all, i replace in widget_text too...

    • 12/20/11 7:55am

      Francisco Javier Carazo Gil says:

      Ok, Sébastien,

      Sorry I thought you didn't know. You can:
      1. Save "widget_text" value
      2. Do a replace all
      3. Update later in DB the "widget_text" field

    • 12/20/11 7:58am

      Sébastien | French WordpressDesigner says:

      okay.....
      But my question is how ?
      How can i save all widget_text in one time
      and update later in DB the "widget_text" field in one time...

    • 12/20/11 8:03am

      Francisco Javier Carazo Gil says:

      Sébastien,

      Try it:
      1. SELECT in your DB over wp_options and save in a text file the value of "widget_text" that is placed in wp_options.
      2. Later, do the dump
      3. In the SQL file replace all
      4. Import again
      5. To finish, with phpMyAdmin update the value of widget_text

      If there are any other value that you want save, do the same process. Before dump save it and in the end update.

    • 12/20/11 8:31am

      Sébastien | French WordpressDesigner says:

      why not.
      but for the 1.
      HOW can i select in my DB over wp_options ?
      with a code i suppose...

    • 12/20/11 8:40am

      Francisco Javier Carazo Gil says:

      With this code:

      SELECT * 
      FROM wp_options
      WHERE option_name LIKE('widget_text');


      You can also do it using phpMyAdmin or any other MySQL client like this one (is my preferred: SQLYog Community Edition).

      Solution given by Julio is smarter.

    • 12/20/11 8:44am

      Sébastien | French WordpressDesigner says:

      this solution select just in wp_options
      so in the main site
      not in others

    • 12/20/11 9:14am

      Francisco Javier Carazo Gil says:

      Sébastien,

      You want to save the value of this field ('widget_text') so you do first this SELECT and later do the dump:
      0. Open phpMyAdmin.
      1. Click Export in the Menu to get to where you can backup you MySql database. Image showing the export menu.
      2. Make sure that you have selected to export your entire database, and not just one table. There should be as many tables in the export list as showing under the database name.
      3. Select"SQL"-> for output format, Check "Structure" and "Add AUTO_INCREMENT" value. Check "Enclose table and field name with backquotes". Check "DATA", check use "hexadecimal for binary field". Export type set to "INSERT".
      4. Check "Save as file", do not change the file name, use compression if you want. Then click "GO" to download the backup file.

    • 12/20/11 11:48am

      Sébastien | French WordpressDesigner says:

      euh... this is the process to export my database ?

    • 12/20/11 11:54am

      Francisco Javier Carazo Gil says:

      Yes, this is the process.

      1. Copy value from widget_text
      2. Export database
      3. Replace all
      4. Import database
      5. Insert data saved from widget_text

    • 12/20/11 11:59am

      Sébastien | French WordpressDesigner says:

      so i think there is a lack of understanding.
      I have a multisite installation.
      if i save the content of my field "widget_text" in wp_options with your code :

      SELECT * 

      FROM wp_options

      WHERE option_name LIKE('widget_text');

      the content of my field "widget_text" in wp_11_options, wp_12_options, wp_13_options, wp_14_options... wp_100_options is not saved.

    • 12/20/11 12:15pm

      Francisco Javier Carazo Gil says:

      Sébastien,

      That's true. The code that Gabriel provide you is the one who needs to save all this data (wp_options_old).

      You create an array:


      for($i=0;$i<100;$i++)
      $myvalues[$i] = $wpdb->get_var( $wpdb->prepare( "SELECT widget_text FROM wp_{$i}_options WHERE option_name LIKE('widget_text')" ) );


      Save the array as a file (for example, 1 row text -> 1 array value). Later you do the process and at the end you do the reverse process, load values from file to array and UPDATE it.


      $wpdb->query("UPDATE wp_{$i}_options
      SET field = myvalues[$i]
      WHERE option_name LIKE ('widget_text' ));

  • avatar
    Last edited:
    12/20/11
    6:38am
    Julio Potier says:

    How can i replace the url every where but not in widget_text
    Is that possible in phpmyadmin ?

    Save the widget_text and after, replace the url everywhere with a sql replace statement. (http://msdn.microsoft.com/fr-fr/library/ms186862.aspx)
    Then, restore widget_text.

    • 12/20/11 6:44am

      Sébastien | French WordpressDesigner says:

      Julio, tu me dis de remplacer le ndd partout puis de restaurer widget_text
      c'est bien ça ?
      parce que justement ma question c'est comment on fait ça ?

      je veux dire par là, que je sais bien remplacer l'url partout, mais par contre je ne sais pas comment la remplacer partout sauf dans widget_text.

    • 12/20/11 6:56am

      Julio Potier says:

      Ok assuming your DB prefix is "wp_", do this :

      0: Save your DB before !
      then

      1st : Save the widget_text

      SELECT option_value FROM wp_options WHERE option_name = 'widget_text'

      Keep this in a notepad text.

      2nd : On each DB table
      UPDATE wp_table SET field = replace(field, 'old TLD', 'new TLD') WHERE city LIKE  '%old%'

      For each table you need to replace (TLD = NDD en français)

      3rd : Restore widget_text
      UPDATE wp_options SET option_value='...' WHERE option_name = 'widget_text'

      Replace my "..." my the data from notepad, the one you kept.

      I think/hope this can resolve your problem.

      ps : C'est important de parler anglais pour que les autres puisse suivre ;)

    • 12/20/11 6:57am

      Julio Potier says:

      puissent*

    • 12/20/11 7:04am

      Sébastien | French WordpressDesigner says:

      WHERE city LIKE '%old%' ???


      if i have 100 sites in my wpmulti, must i do that 100 times ?

    • 12/20/11 7:12am

      Julio Potier says:

      oups "city" = "field" and "old"/"new" are old and new TLD.

      I don't think you have to do this X times / wpmulti but X times / table needed.

      How many tables do you have ?

    • 12/20/11 7:15am

      Sébastien | French WordpressDesigner says:

      J'ai 100 sites, et donc 100 fois widget_text

      i have 100 sites and 100 times widget_text

    • 12/20/11 7:20am

      Julio Potier says:

      Bad ...
      In your case we can do this for the update on wp_options :

      UPDATE wp_options SET field = replace(field, 'old TLD', 'new TLD') WHERE field LIKE '%old%' AND option_name != 'widget_text'


      I think this is better, and point 1 and 3 became useless now.

    • 12/20/11 7:56am

      Sébastien | French WordpressDesigner says:

      pas sur de comprendre. Ce code va agir sur tous les sites de la plateforme en même temps ?

      Not sur to understand : this code will update all sites of my network at a time ?

    • 12/20/11 7:57am

      Julio Potier says:

      Logically yes

    • 12/20/11 8:03am

      Sébastien | French WordpressDesigner says:

      But Julio, wp_options exist only in the main site
      The thers have a table like that
      wp_12_options
      wp_13_options
      wp_14_options

      your code can't update all sites...

    • 12/20/11 8:10am

      Julio Potier says:

      Damn me ...

      So you can create a routine like :

      <?php
      DEFINE('SHORT_INIT', true);
      require_once( 'wp-load.php' );
      global $wpdb;
      for( $i = 1; $i <= 100; $i++ ) {
      $wpdb->query("UPDATE wp_{$i}_options SET field = replace(field, 'old TLD', 'new TLD') WHERE field LIKE '%old%' AND option_name != 'widget_text' );
      }
      ?>


      Put this in a file at WordPress root (near wp-load.php so)

    • 12/20/11 8:33am

      Sébastien | French WordpressDesigner says:

      ouep
      ou alors je change l'ancienne url par la nouvelle, dans toute la db
      et ensuite je fais une routine dans function.php pour remettre l'ancienne url dans widget_text...
      :-)
      ------------
      yes, or i update all my db with the new url
      and in function.php i create a routine to change the new url by the old url in widget_text
      :-)

    • 12/20/11 8:36am

      Julio Potier says:

      A revert solution yes ;)

    • 12/20/11 1:21pm

      Sébastien | French WordpressDesigner says:

      Julio, just one thing :
      with your code, in all site, i can update the url in the field "widget_text".


      <?php

      DEFINE('SHORT_INIT', true);

      require_once( 'wp-load.php' );

      global $wpdb;

      for( $i = 1; $i <= 100; $i++ ) {

      $wpdb->query("UPDATE wp_{$i}_options SET field = replace(field, 'old TLD', 'new TLD') WHERE field LIKE '%old%' AND option_name != 'widget_text' );

      }

      so if my old url is http://oldurl.com, it is updated and will become http://newurl.com

      BUT in my widgets, the url is url of a sub-site.
      So the url can be http://site1.oldurl.com for example and i would update it like that : http://site1.newurl.com

      could i use your code like that :

      <?php

      DEFINE('SHORT_INIT', true);

      require_once( 'wp-load.php' );

      global $wpdb;

      for( $i = 1; $i <= 100; $i++ ) {

      $wpdb->query("UPDATE wp_{$i}_options SET field = replace(field, 'oldurl.com', 'newurl.com') WHERE field LIKE 'oldurl.com' AND option_name != 'widget_text' );

      }

      with this code, does the value http://site1.oldurl.com become http://site1.newurl.com ?

    • 12/20/11 1:24pm

      Julio Potier says:

      Of course yes !

    • 12/20/11 1:50pm

      Sébastien | French WordpressDesigner says:

      in my DB i replaced the old url by the new url
      and now i want to change the new url by the old url only in fields "widget_text"

      i have add this code in my functions.php

      function recup_widget_slh() {
      global $wpdb;

      for( $i = 1; $i <= 100; $i++ ) {
      $sql = "UPDATE wpavignon_{$i}_options SET field = replace(field, 'oldurl.fr', 'newurl.fr') WHERE field LIKE 'oldurl.fr' AND option_name = 'widget_text'";
      $wpdb->query( $sql );
      }
      }

      add_action('admin_init', 'recup_widget_slh');

      but the widgets are not reappeared

      isn't my code correct ?

    • 12/20/11 2:22pm

      Sébastien | French WordpressDesigner says:

      Finally i used your method.
      i create a file slh.php at the root near wp-load.php
      i uploaded the db of the site to the test site.
      i go to the url of the test site and i see this message

      La page n'est pas redirigée correctement
      Firefox a détecté que le serveur redirige la demande pour cette adresse d'une manière qui n'aboutira pas.


      In the DB, i verify : nothing has changed.

      I have probably a mistake. But where ?

    • 12/20/11 3:23pm

      Julio Potier says:

      It seems like a bad php loop.
      Can you paste your slh.php file here ?

    • 12/20/11 3:41pm

      Sébastien | French WordpressDesigner says:

      content of slh.php


      <?php

      DEFINE('SHORT_INIT', true);

      require_once( 'wp-load.php' );

      global $wpdb;

      for( $i = 1; $i <= 100; $i++ ) {

      $wpdb->query("UPDATE wp_{$i}_options SET field = replace(field, 'oldurl.fr', 'newurl.fr') WHERE field LIKE 'oldurl.fr' AND option_name != 'widget_text'" );

      }

      ?>

    • 12/20/11 5:11pm

      Julio Potier says:

      wp_{$i}_options

      or
      wpavignon_{$i}_options

      ??

    • 12/20/11 5:15pm

      Sébastien | French WordpressDesigner says:

      Bien vu !!
      Cela dit même avec wpavignon ça ne change rien


      well seen (??)
      but with wpavignon nothing has changed

    • 12/20/11 5:18pm

      Julio Potier says:

      strange ... do a "echo" in place of "$wpdb-query" just to be sure ...
      Is my for loop ok ? or it's a infinite loop !? i doubt ...

    • 12/20/11 5:23pm

      Sébastien | French WordpressDesigner says:

      i can't seen the result, i have an error page

    • 12/20/11 5:28pm

      Julio Potier says:

      Earlyer you said :

      in my DB i replaced the old url by the new url
      and now i want to change the new url by the old url only in fields "widget_text"

      With "field" in the query ? Are you sure the old pattern have been replaced ?

      My bad, i typed "field" as example :/
      Replace field by option_value

    • 12/20/11 5:29pm

      Julio Potier says:

      For wp_posts for example you have to replace old url in these fields "post_content", "post_excerpt", "guid".

    • 12/20/11 5:34pm

      Sébastien | French WordpressDesigner says:

      the code of slh.php is exactly :

      <?php

      DEFINE('SHORT_INIT', true);

      require_once( 'wp-load.php' );

      global $wpdb;

      for( $i = 1; $i <= 100; $i++ ) {

      $wpdb->query("UPDATE wpavignon_{$i}_options SET field = replace(field, 'ville-avignon.fr', 'mairie-avignon.fr') WHERE field LIKE 'ville-avignon.fr' AND option_name != 'widget_text'" );

      }

      ?>

      and the result is :
      La page n'est pas redirigée correctement
      Firefox a détecté que le serveur redirige la demande pour cette adresse d'une manière qui n'aboutira pas.

    • 12/20/11 5:37pm

      Sébastien | French WordpressDesigner says:

      Sorry ^^
      the code is exactly

      <?php

      DEFINE('SHORT_INIT', true);

      require_once( 'wp-load.php' );

      global $wpdb;

      for( $i = 1; $i <= 100; $i++ ) {

      $wpdb->query("UPDATE wpavignon_{$i}_options SET option_value = replace(option_value, 'ville-avignon.fr', 'mairie-avignon.fr') WHERE option_value LIKE 'ville-avignon.fr' AND option_name != 'widget_text'" );

      }

      ?>

    • 12/20/11 5:37pm

      Sébastien | French WordpressDesigner says:

      Sorry ^^
      the code is exactly

      <?php

      DEFINE('SHORT_INIT', true);

      require_once( 'wp-load.php' );

      global $wpdb;

      for( $i = 1; $i <= 100; $i++ ) {

      $wpdb->query("UPDATE wpavignon_{$i}_options SET option_value = replace(option_value, 'ville-avignon.fr', 'mairie-avignon.fr') WHERE option_value LIKE 'ville-avignon.fr' AND option_name != 'widget_text'" );

      }

      ?>

    • 12/20/11 5:44pm

      Sébastien | French WordpressDesigner says:

      the problem : in wp-config i have :

      define( 'MULTISITE', true );
      define( 'SUBDOMAIN_INSTALL', true );
      $base = '/';
      define( 'DOMAIN_CURRENT_SITE', 'NEW-URL.fr' );
      define( 'PATH_CURRENT_SITE', '/' );
      define( 'SITE_ID_CURRENT_SITE', 1 );
      define( 'BLOG_ID_CURRENT_SITE', 1 );


      a redirection to NEW URL
      but in the DB is the db of the old TLD...

      if i change and replace by
      define( 'DOMAIN_CURRENT_SITE', 'OLD-URL.fr' );
      i haven't problem, no error message, but a redirection to the old url ^^

    • 12/21/11 1:20am

      Julio Potier says:

      So we gonna try to do this old school style by using a manual sql connexion ^^

      <?php $connection = @mysql_connect ('host','login','pass') or die('La connexion a la base de données a échoué.');
      @mysql_select_db ('dbname',$connection) or die('Problème avec la base');

      for( $i = 1; $i <= 100; $i++ ) {
      $sql = "UPDATE wpavignon_{$i}_options SET option_value = replace(option_value, 'ville-avignon.fr', 'mairie-avignon.fr') WHERE option_value LIKE 'ville-avignon.fr' AND option_name != 'widget_text'";
      $req = mysql_query($sql) or die("Erreur sql : ".mysql_error());
      }


      This query will replace the OLDURL by the NEWURL, but not for the widget_text.
      Do not forget to replace "host", "login", "password", "dbname" ;)

    • 12/21/11 8:24am

      Sébastien | French WordpressDesigner says:

      and a code to verify that the table exist (many $blog_id not exist, ie : 56 or 67 are deleted) and it's perfect !

    • 12/21/11 8:27am

      Julio Potier says:

      Do not verify, just avoid to "die" ;)

      $req = mysql_query($sql);

    • 12/21/11 8:40am

      Sébastien | French WordpressDesigner says:

      in my case wpavignon_1_options doesn't exist
      so i have a message :
      Erreur sql : Table 'site2_bdd.wpavignon_1_options' doesn't exist
      and i think that nothing happened in the db.

    • 12/21/11 10:32am

      Julio Potier says:

      Try this :
      <?php
      $connection = @mysql_connect ('host','login','pass') or die('La connexion a la base de données a échoué.');

      @mysql_select_db ('dbname',$connection) or die('Problème avec la base');


      for( $i = 1; $i <= 100; $i++ ) {

      $sql = "IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND TABLE_NAME='wpavignon_{$i}_options') UPDATE wpavignon_{$i}_options SET option_value = replace(option_value, 'ville-avignon.fr', 'mairie-avignon.fr') WHERE option_value LIKE 'ville-avignon.fr' AND option_name != 'widget_text'";

      $req = mysql_query($sql) or die("Erreur sql : ".mysql_error());

      }
      ?>

    • 12/21/11 12:12pm

      Sébastien | French WordpressDesigner says:

      Erreur sql : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'' at line 1

    • 12/30/11 10:47am

      Sébastien | French WordpressDesigner says:

      test

    • 12/30/11 10:54am

      Sébastien | French WordpressDesigner says:

      Julio,

      J'ai trouvé une astuce.

      Je change l'url dans toute la base de donnée et ensuite j'utilise une fonction pour remettre l'ancienne url dans les widget_text.

      J'ai résolu le problème des blogs dont l'identifiant n'existe pas.

      Par contre la fonction update que tu m'as donnée ne semble pas fonctionner.
      ça ne change rien dans la base de donnée.

      Tu peux regarder stp ?
      (le prefix de la base = wp_)

      function recup_widget_slh() {

      global $wpdb;
      global $blog_id;
      $table_prefix = $wpdb->base_prefix;

      $sql = "SELECT blog_id FROM ".$table_prefix ."blogs";
      $blogids_list = $wpdb->get_results($sql);
      //print_r ($blogid_list);
      $table_blogID = array();
      foreach ($blogids_list as $list) {$table_blogID[] = $list->blog_id;};



      for( $i = 1; $i <= 100; $i++ ) {
      if (in_array($i, $table_blogID)){
      $sql = "UPDATE wp_{$i}_options SET field = replace(field, 'http://site4-xaneconcept.fr/wp-content/gallery', 'http://mairietoulouse.fr/wp-content/gallery') WHERE field LIKE 'http://site4-xaneconcept.fr/wp-content/gallery' AND option_name = 'widget_text'";
      $wpdb->query( $sql );
      //$result = $wpdb->get_results($sql);
      } else {echo "pas de blog portant le numero ".$i."<br>";}
      }

      }


      add_action('admin_init', 'recup_widget_slh');





      ---

      Julio,

      I found a trick.

      I change the url in the whole database and then I use a function to return the old url in widget_text.

      I solved the problem of blogs whose identifier does not exist.

      As against the update function you gave me is not working.
      does not change anything in the database.

      You can look at stp?
      (prefix base = wp_)

      function recup_widget_slh() {

      global $wpdb;
      global $blog_id;
      $table_prefix = $wpdb->base_prefix;

      $sql = "SELECT blog_id FROM ".$table_prefix ."blogs";
      $blogids_list = $wpdb->get_results($sql);
      //print_r ($blogid_list);
      $table_blogID = array();
      foreach ($blogids_list as $list) {$table_blogID[] = $list->blog_id;};



      for( $i = 1; $i <= 100; $i++ ) {
      if (in_array($i, $table_blogID)){
      $sql = "UPDATE wp_{$i}_options SET field = replace(field, 'http://site4-xaneconcept.fr/wp-content/gallery', 'http://mairietoulouse.fr/wp-content/gallery') WHERE field LIKE 'http://site4-xaneconcept.fr/wp-content/gallery' AND option_name = 'widget_text'";
      $wpdb->query( $sql );
      //$result = $wpdb->get_results($sql);
      } else {echo "pas de blog portant le numero ".$i."<br>";}
      }

      }


      add_action('admin_init', 'recup_widget_slh');

    • 12/30/11 11:05am

      Sébastien | French WordpressDesigner says:

      afin de verifier j'ai créé un widget contenant le mot sebseb

      et j'ai changé la function comme ceci


      function recup_widget_slh() {

      global $wpdb;
      global $blog_id;
      $table_prefix = $wpdb->base_prefix;

      $i=53;
      $sql = "UPDATE wp_{$i}_options SET field = replace(field, 'sebseb', 'remplacementdemot') WHERE field LIKE 'sebseb' AND option_name = 'widget_text'";
      $wpdb->query( $sql );
      //$result = $wpdb->get_results($sql);


      }


      add_action('admin_init', 'recup_widget_slh');


      ensuite j'ai regardé si mon widget avait changé dans le blog 53
      mais non il n'a pas changé.

      -------
      to check I created a widget containing the word sebseb

      and I changed the function like this

      function recup_widget_slh() {

      global $wpdb;
      global $blog_id;
      $table_prefix = $wpdb->base_prefix;

      $i=53;
      $sql = "UPDATE wp_{$i}_options SET field = replace(field, 'sebseb', 'remplacementdemot') WHERE field LIKE 'sebseb' AND option_name = 'widget_text'";
      $wpdb->query( $sql );
      //$result = $wpdb->get_results($sql);


      }


      add_action('admin_init', 'recup_widget_slh');




      Then I checked if my widget has changed in the 53 blog
      but no it has not changed.

    • 12/30/11 11:15am

      Sébastien | French WordpressDesigner says:

      Juste une petite rectification : ma fonction est

      function recup_widget_slh() {

      global $wpdb;
      global $blog_id;
      $table_prefix = $wpdb->base_prefix;

      $sql = "SELECT blog_id FROM ".$table_prefix ."blogs";
      $blogids_list = $wpdb->get_results($sql);
      //print_r ($blogid_list);
      $table_blogID = array();
      foreach ($blogids_list as $list) {$table_blogID[] = $list->blog_id;};



      foreach ($table_blogID as $i) {
      $sql = "UPDATE wp_{$i}_options SET option_value = replace(option_value, 'sebseb', 'remplacement') WHERE option_value LIKE 'sebseb' AND option_name = 'widget_text'";
      $wpdb->query( $sql );
      //$result = $wpdb->get_results($sql);
      }

      }


      add_action('admin_init', 'recup_widget_slh');

      cela dit ça ne fonctionne toujours pas

      je vois en home du site que tu as posté une reponse, mais je ne la vois pas... envoie moi la en mp eventuellement

This question has expired.





Current status of this question: Community pot



Please log in to add additional discourse to this page.





Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.