MySQL to MS SQL Server

Exporting Data from MySQL and importing to SQL Server

today I was wanting to do a tutorial with SQL server stored procedures to I wanted to import some data from a MySQL database that I had. not as simple as one might have thought.

Steps:

  • export from MySQL as SQLSVR specific brand of SQL
  • Change data type int(11) to [int]
  • Change tinyint to [int] ot bit depending on data
  • change any dates set to ‘0000-00-00’ to an actual date or NULL
  • change date defaults to NULL if set to ‘0000-00-00’
  • replace ` with ‘

Sharing webhosting for multiple domains

I have a web hosting plan that allows for many parked domains but does not allow for addon domains. Extra cost I don’t need.
So how does one make use of a parked domain.
The intent is to have a number of domains that all point to the same site.

eg maindomain.com.au is my primary site and I have also bought maindomain.net.au and maindomain.com and maindomain.net So I park all of these domains and make my site. So no matter which site you type in you get the same content. Good easy.

Now for complications. I want to have multiple sites on my hosting and park all of the domains on my hosting and have a folder for each site then tell the hosting to show each as if it were the root. Shouldn’t be too hard I hear you say.

Given the long time delay between such projects one tends to forget the intricacies of such swifties. Well this one does anyway. So my darling wife suggested I write it down. But where? I hate having bits of paper floating around and am not quite organised enough to have a file somewhere I can get at it. Good a reason for a blog…

OK so here’s the scenario:

  • Webhosting base domain maindomain.com.au
  • new domain purchased http://newbiz.com.au/
  • Build a nice wordpres site in ./wordpress folder off the root

Now for the messing around:

  • Park domain newbiz.com.au
  • Set a redirect for this domain to /wordpress/ folder
  • create a file in the root of the public file stucture called .htaccess
  • insert the following:
options -indexes
RewriteEngine On
RewriteCond %{HTTP_HOST} newbiz.com.au
RewriteCond %{REQUEST_URI} !^wordpress
RewriteRule ^(.*)$ wordpress/$1 [L]

Now go into the wordpress directory and make an .htaccess file and add this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule> # END WordPress

Now in wordpress settings set the site address to crystalcomputertechnology.com.au and leave the wordress address pointing to the directory ie. crystalcomputertechnology.com.au/wordpress

Any further domains have a similar entry in the .htaccess in the root public_html folder and get their own .htaccess in their own folder.

 

Website Hacking

I recently fell victim to a website hack. It took a bit to find where they had hidden their replacement for my site. Thankfully they didn’t trash my content. I haven’t found out how they got in to do their deed. I was not a happy camper when I was told about it. lucky for me it was the day after the attack so I was not off the air for too long.

The hackers had replaced an index.php file in the theme folder I was using. Easy enough to fix once I found it.