<br />
<b>Warning</b>:  strpos() expects parameter 1 to be string, array given in <b>/home/theserverside/public_html/wp-includes/blocks.php</b> on line <b>20</b><br />
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>website &#8211; The Server Side Technology</title>
	<atom:link href="https://www.theserverside.technology/it/tag/website/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.theserverside.technology/it</link>
	<description>in-depth information for tech pros</description>
	<lastBuildDate>Tue, 08 Oct 2019 22:32:20 +0000</lastBuildDate>
	<language>it-IT</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0.18</generator>
	<item>
		<title>WordPress and MySQL: fixing the wp_options table</title>
		<link>https://www.theserverside.technology/it/2019/10/08/wordpress-and-mysql-fixing-the-wp_options-table/?pk_campaign=feed&#038;pk_kwd=wordpress-and-mysql-fixing-the-wp_options-table</link>
					<comments>https://www.theserverside.technology/it/2019/10/08/wordpress-and-mysql-fixing-the-wp_options-table/?pk_campaign=feed&#038;pk_kwd=wordpress-and-mysql-fixing-the-wp_options-table#respond</comments>
		
		<dc:creator><![CDATA[Guglielmo Mengora]]></dc:creator>
		<pubDate>Tue, 08 Oct 2019 22:32:17 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Web Technologies]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://www.theserverside.technology/?p=1390</guid>

					<description><![CDATA[<div style="margin: 5px 5% 10px 5%;"><img src="https://www.theserverside.technology/wp-content/uploads/2019/10/wordpress-1920-300x199.jpg" width="300" height="199" title="" alt="" /></div><div>
<p class="has-drop-cap">We had a weird problem when moving a WordPress website for a customer: after DUMPing it out of MySQL, we noted that the wp_options table had a problem, namely the table had no primary key and no index on the option_name field. We noted that because the WordPress website, once moved, looked akward and wrong, missing some key pieces and it also seemed to use settings that were old. The reason was that, with primary key missing, lots of duplicate records were stored inside the table and I&#8217;m pretty sure it was not what the website was meant to do. Field option_id was set to 0 in most cases when it should have been an auto-incremented integer plus it seemed that the website was not updating settings, rather it was storing a new copy of them each time.</p>



<p>The akward look was probably due to WordPress not being able to load-up the most recent settings but the weird thing was that it was working like a charm on its existing server. However, we noticed that the source server was running MySQL 5.1 while the destination was instead running MySQL 5.7. MySQL is that weird beast where everything can happen but anyway that 5.1 version was really really old. I would expect such things not to happen in an enterprise world (never had such problems with SQL Server) but&#8230;</p>



The problem



<p>So the first problem we had to solve was re-enabling primary key for field option_id and its indices but we couldn&#8217;t add a primary key on that field since thousands of record were using the same key (zero) so we had to find a way to update them with a unique value. The best solution would be to have consecutive integers though that wouldn&#8217;t ensure that we are restoring the right order. But I&#8217;m afraid there&#8217;s no real way to be sure about that. However, when enumerating records one might assume that the table scan would populate results from the oldest to the newest. Not sure about this but we might try.</p>



<p>So we basically developed a stored procedure that would scan that table and update each record to set a new option_id. One of the key problems with this is that you need to perform only an update at a time because you cannot use any relevant key to uniquely get the record given that option_id is zero. Other fields might be the same for multiple records so for example if we try to select records based on option_name we might have multiple records update with the same option_id and we wouldn&#8217;t solve our problems.</p>



<p>We might just hope that we&#8217;re lucky enough so that scanning for zero keys and updating just a single record would just update in the same order. Anyway, the key to change the table design is to have different keys, it is not strictly necessary to have the same order though quirks might happen if we don&#8217;t do that. The real important thing is to ensure we won&#8217;t [...]<img src="https://stats1.vaisulweb.cloud/piwik.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fwww.theserverside.technology%2Fit%2F2019%2F10%2F08%2Fwordpress-and-mysql-fixing-the-wp_options-table%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dwordpress-and-mysql-fixing-the-wp_options-table&amp;action_name=WordPress%20and%20MySQL%3A%20fixing%20the%20wp_options%20table&amp;urlref=https%3A%2F%2Fwww.theserverside.technology%2Fit%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" /></div>]]></description>
		
					<wfw:commentRss>https://www.theserverside.technology/it/2019/10/08/wordpress-and-mysql-fixing-the-wp_options-table/?pk_campaign=feed&#038;pk_kwd=wordpress-and-mysql-fixing-the-wp_options-table/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://www.theserverside.technology/wp-content/uploads/2019/10/wordpress-1920.jpg" length="417896" type="image/jpg" />
<media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://www.theserverside.technology/wp-content/uploads/2019/10/wordpress-1920-300x199.jpg" width="300" height="199" medium="image" type="image/jpeg">
	<media:copyright>The Server Side Technology</media:copyright>
	<media:title></media:title>
	<media:description type="html"><![CDATA[]]></media:description>
</media:content>
<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.theserverside.technology/wp-content/uploads/2019/10/wordpress-1920-300x199.jpg" width="300" height="199" />
	</item>
		<item>
		<title>Windows Azure Pack: how to restart an over-quota website</title>
		<link>https://www.theserverside.technology/it/2015/11/02/windows-azure-pack-how-to-restart-an-over-quota-website/?pk_campaign=feed&#038;pk_kwd=windows-azure-pack-how-to-restart-an-over-quota-website</link>
					<comments>https://www.theserverside.technology/it/2015/11/02/windows-azure-pack-how-to-restart-an-over-quota-website/?pk_campaign=feed&#038;pk_kwd=windows-azure-pack-how-to-restart-an-over-quota-website#respond</comments>
		
		<dc:creator><![CDATA[Guglielmo Mengora]]></dc:creator>
		<pubDate>Mon, 02 Nov 2015 23:56:37 +0000</pubDate>
				<category><![CDATA[Cloud Technologies]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[clienti]]></category>
		<category><![CDATA[customers]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[windows azure pack]]></category>
		<guid isPermaLink="false">http://www.theserverside.technology/?p=849</guid>

					<description><![CDATA[<div style="margin: 5px 5% 10px 5%;"><img src="https://www.theserverside.technology/wp-content/uploads/2015/11/http-300x225.jpg" width="300" height="225" title="" alt="" /></div><div><p>Windows Azure Pack is a great technology but sometimes Microsoft seems to be missing the complexity of providing services to hundreds if not thousands of customers, each of them with different needs. Standardization is good but it should provide enough flexibility to manage things in a reasonable way. So here&#8217;s the scenario: you deployed WAP and your customer starts to buzz into your server because how good WAP actually is. Rock solid, able to run most demanding websites. Great technology, I said.</p>
<p>However, one of your customers runs over his allotted quota of one of the seventeen metrics you can monitor for your websites. Since your customer didn&#8217;t opt for a pay-per-use billing model, you just suspend his website, like any hoster in the world would do, and your customer calls in to buy more &#8220;of that something&#8221;. He pays (if needed), if you&#8217;re like us he gets an add-on to increase his quota over a standardized plan and, after a while and a little synchying, WAP states that his account is now back in quota. End of story.</p>
<p>Well, almost! Because your customer calls in again stating that his website is still suspended while on his portal he sees no over-quota warnings and you realized that he is right: no warnings, increased quota but website still suspended. Hmmm&#8230;</p>
<p>From now on, you start a journey to understand why WAP didn&#8217;t re-enable that website. You try to update plans, subscriptions, add-ons, force subscription resynchying, force plans to update, open-up Powershell to look for a well-hidden parameter that will allow you tell WAP to re-evaluate quota and re-enable website, or (at least) a cmdlet to tell WAP to re-enable that #&#38;%$@#!$ website because I&#8217;m the one who rules here. Apparently, you discover that there isn&#8217;t anything like that: no way to re-enable a website that is over quota. So you basically look at portal where it states that counters will be reset in 29 days and you start thinking if WAP really wants to re-evaluate quota in 29 days from today. You wait in the hope that it will take a little time to start that website again but no luck. After hours, you really start to think that WAP will keep that website suspended until it will be time to reset counters, which is obviously totally unacceptable. But the most scary thing is that you cannot force it to change his mind. You&#8217;re basically powerless.</p>
<p>After a little checking, it turns out what I stated is not true for all quota items. For example, a short while after upgrading (by adding an add-on) sent bytes quota, a suspended website has been restarted by WAP itself. However, there are other counters that seem to be evaluated only when their configured period will expire, for example CPU burst and received bytes. No matter how long you wait after changing those, WAP won&#8217;t restart the affected website. I&#8217;m talking about hours here, not minutes, but I couldn&#8217;t wait days to check if it would happen after 29 days as suspected. [...]<img src="https://stats1.vaisulweb.cloud/piwik.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fwww.theserverside.technology%2Fit%2F2015%2F11%2F02%2Fwindows-azure-pack-how-to-restart-an-over-quota-website%2F%3Fpk_campaign%3Dfeed%26pk_kwd%3Dwindows-azure-pack-how-to-restart-an-over-quota-website&amp;action_name=Windows%20Azure%20Pack%3A%20how%20to%20restart%20an%20over-quota%20website&amp;urlref=https%3A%2F%2Fwww.theserverside.technology%2Fit%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" /></div>]]></description>
		
					<wfw:commentRss>https://www.theserverside.technology/it/2015/11/02/windows-azure-pack-how-to-restart-an-over-quota-website/?pk_campaign=feed&#038;pk_kwd=windows-azure-pack-how-to-restart-an-over-quota-website/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<enclosure url="https://www.theserverside.technology/wp-content/uploads/2015/11/http.jpg" length="1323890" type="image/jpg" />
<media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://www.theserverside.technology/wp-content/uploads/2015/11/http-300x225.jpg" width="300" height="225" medium="image" type="image/jpeg">
	<media:copyright>The Server Side Technology</media:copyright>
	<media:title></media:title>
	<media:description type="html"><![CDATA[]]></media:description>
</media:content>
<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://www.theserverside.technology/wp-content/uploads/2015/11/http-300x225.jpg" width="300" height="225" />
	</item>
	</channel>
</rss>
