Posts tagged with 'godaddy'

Backing up SQL Server database with GoDaddy

Nearly two weeks ago, I converted this site to use SQL Server as the database engine. Without a doubt, having the database on another server separate from the main web server has helped the speed of this site dramatically, so much so that I've added features like the "top five most popular posts" gadget to the first sidebar and "other similar posts" to each blog post (when they're displayed on their own).

The only problem that I've had is that my backups of the site have reduced in frequency equally dramatically. Why? Just the sheer number of steps I have to go through to perform a database backup on GoDaddy. For fun, here's the full process:

Step 1 Go to the GoDaddy home page and log in:

Step 2 Click on the My Hosting Account menu item

Step 3 When your accounts are displayed, click on the Manage Account link for the account that has the SQL Server database:

Step 4 Click on the Databases menu and select SQL Server:

Step 5 When the list of databases is then displayed, click on the pencil icon to view the database details:

Step 6 Click on the Backup icon:

Step 7 Finally, it's time to initiate the actual backup by clicking OK on the resulting pane:

Note, though, that I have no way to specify the backup file name, so that, perhaps, I can take a daily backup and have the ability to go back to a particular day; that therefore the old backup file is going to get overwritten; that I won't know or get notified that the backup is complete (apart from the rather wishy-washy "up to 2 hours" text).

Final step (number 8) Of course, now I have to download the resulting backup file using FTP onto my local machine.

To be brutally honest, this is way too many steps. Creating backups that I can download are just not going to get done with any regularity. Since I do have remote access to the SQL Server instance, another way of doing this might have been to use SQL Server Management Studio, but that seems to want to backup to a folder on the same machine as the server instance, and I don't have such access.

I know that GoDaddy back up their own servers (well, all right, I assume that they are), but as Jeff Atwood said today on Twitter after suffering a complete server crash which wiped out Coding Horror: "for the record, I blame 50% hosting provider, 50% myself (don't trust the hosting provider, make your OWN offsite backups, too!)". To be faced with that possibility is the stuff of nightmares…

Album cover for The EyeNow playing:
Yello - Junior B
(from The Eye)


Share it: Digg It!  StumbleUpon  Reddit  Del.icio.us  NewsVine  Furl  BlinkList  Ma.gnolia  Technorati

Converting GraffitiCMS from VistaDB to SQL Server on GoDaddy

Is that SEO-specific enough, do you think? Heh. Anyway, here's the situation. I started this blog using GraffitiCMS about a year ago, previously having used static web pages created with CityDesk. All my sites are hosted on GoDaddy: I went with a Deluxe hosting option which means I can host pretty much as many sites as I want to in the same single folder tree.

At the time — can't remember why — I decided to stick with the default VistaDB as the database instead of opting to go to SQL Server. Throughout the year, things have been good, no issues whatsoever, so my decision seemed sane. Until about two weeks ago that is, when everything went to hell in a handcart in a hurry. Essentially, for a whole week, this blog went offline:

Visits fall off a cliff 

I still don't know what was up. I uploaded a blog post the day before, then, blam, November 15th was a black hole that lasted 6 days. As detailed here, I tried to fix it once I was back home from PDC — thought I'd had, but ever since it's been acting weird. Every now and then, for no discernable reason I can see, some process (obviously an ASP.NET IIS process) locks some section of the VistaDB database file and it's curtains for the blog until the process resets, several hours later. I'm guessing that it's some bug in GraffitiCMS and one request is hanging, causing everything else to hang. Or it's because something is timing out from taking too long. At any rate the log slowly starts to fill up with errors, since every three minutes or so some process kicks off to clean out deleted records:

Error logs

Plus the site has suddenly been acting as if it's very tired. It's just been plain slow. Just nasty to use (I was counting something like 7 seconds for a blog post to come up).

Finally yesterday I'd had enough. The site locked up again (for about 5 hours this time), so it was just time to move to SQL Server. At least with that I have some diagnostic tools and the like to find out what's going on.

With my GoDaddy hosting plan I have the ability to have up to 2 SQL Server databases. Not many, Benny, but then again I only need one. First problem is that, by default, GoDaddy does not expose your SQL Server database for remote access. They provide a nice web-based tool to manage your database, but it seemed a little limiting to me: I wanted to use SQL Server Management Studio to manage my database. Plus, the only way I was going to be able to get all my data into the database was to do it via a remote connection.

So I fired off an email to support asking for the right to access my database remotely. I got a reply back after three hours saying that I should delete my current databases (after backing them up of course). Also they had to move my whole domain onto another hosting server in order to allow remote access to the database. No problem (I only had a test database to try out the standard GoDaddy tools and this was soon dropped), so I quickly replied that my domain was ready to be moved. Four hours later, I got a reply saying, in effect, that "due to its complex nature, your issue has been relayed to our Advanced Technical Support Team". OK, I let support take their course and went to bed.

This morning, I had a slew of messages saying that the move had been successful and that I could now access SQL Server remotely. Amazingly the whole site was much more responsive than before: I reckon the previous hosting server was a bit overloaded (perhaps this was also part of my problem?). This evening, then, was the time for the Big Conversion.

1. I logged into my hosting account on GoDaddy and created a new database. On the database creation page was a radio button to state whether this database could be connected to remotely or not, something that had been missing before:

Remote access FTW 

I made sure that the button was set to Yes. 5 minutes or so later, the database had been created.

2. I fired up SQL Server Management Studio (SSMS) 2008 and connected to the SQL Server URL given by the database configuration page, providing the user name and password I'd set up for the database. It connected just fine.

3. However, when I tried to open the Databases node in the Object Explorer, I got SQL Server error 916. My credentials were not able to access another database I'd never heard of. I went back to the SSMS server login dialog, and added my database name. Same error. I googled for the answer and found this article by Clay Burt that described the same issue. It made reference to this Microsoft Connect post about how to fix the problem. Once I did this and refreshed, I saw a huge long list of the databases on the server, of which mine was one. (Of course, the only database I was able to open was my own.)

4. I opened my database in SSMS and then ran the Graffiti_SQL_Schema.sql script (it's in the top level \Data folder of the GraffitiCMS install). This created the database schema that Graffiti uses. Then it was time for the data.

5. I copied my whole GraffitiCMS site from GoDaddy onto my local disk. I normally do this for backups every couple of days anyway, but this time I wanted to make sure I had the latest, most-up-to-date Vista VDB3 database file. I was going to be using the DataMover utility to copy the data over to SQL Server. I set an "under repair" default.html file in the root folder so that visitors would know something was going on.

6. Now it was time for DataMover. This utility is found in the \Data\Utility\Migrations folder of the GraffitiCMS install. It requires two databases: the source and the destination. For the source, I browsed to the folder containing the VDB3 file I'd just downloaded, and for the target, I entered in the .NET connection string that pointed to the GoDaddy SQL Server instance that was hosting my database. (GoDaddy provide this in their database control panel. Open the database control panel, click on the pencil icon next to your database, then click on Configuration. Find the one that says .NET, it's just a case of selecting it all, copy-and-pasting it, and then overwriting the dummy password with the real one). I clicked Copy Data and then started to write this blog post about how I did it all.

7. Once all the data had been copied to the SQL Server database, it was time to fix the web.config file that I'd downloaded. First of all, I located the current connection string. It looked like this for me:

<add name="Graffiti" connectionString="Data Source=|DATADIRECTORY|\boyetblog.vdb3" />

I changed it to look like this (with certain values changed to protect the innocent, namely, me):

<add name="Graffiti" connectionString="Data Source=boyetblog.db.999999999.hostedresource.com;Initial Catalog=BoyetBlog;Persist Security Info=True;User ID=userid;Password=password;" />

Now I had to change the data provider. Further down web.config, there's a line that said:

<add key="DataBuddy::Provider" value="DataBuddy.VistaDBProvider, DataBuddy"/>

And I changed it to look like this:

<add key="DataBuddy::Provider" value="DataBuddy.SQL2K5DataProvider, DataBuddy"/>

I then uploaded the changed web.config file to the root of my blog site.

8. Time to test. I played around with as many features of the site that I could, especially the admin pages, including reporting. All seemed to work just fine. In fact, better than that, it is rip-roaringly fast. Having the database engine on a separate machine from the hosted web server is just slick like skates on ice.

 

Album cover for World MachineNow playing:
Level 42 - World Machine
(from World Machine)


Share it: Digg It!  StumbleUpon  Reddit  Del.icio.us  NewsVine  Furl  BlinkList  Ma.gnolia  Technorati

Losing Permissions with GoDaddy

I noticed this a couple of weeks ago, but couldn't pin it down to anything. All of a sudden, the Graffiti application used to run this blog suddenly stopped working, throwing up its generic error page. After a little bit of investigation why, I found out that the write permissions on the blog root folder had been cleared.

So I set them back, and promptly forgot about it.

Well, it happened again yesterday afternoon and the only thing that I had done with regard to my website configuration was to create a new subdomain of boyet.com: acting.boyet.com. This is a convenient place to hold my acting résumé (I had an audition yesterday afternoon, and I thought this would be an ideal short URL to write down on the audition form — no slashes or other weird characters).

It seems that adding the new subdomain to boyet.com did two things. First, it added the target folder for the subdomain to my IIS settings. Don't know why, but I removed it. And then, second, it cleared the write permissions to my blog subdomain and without write permissions, Graffiti can't run and throws up the error page.

And then I remembered what had happened last time this had happened: I'd just registered imetjulian.com and added it to my hosting account.

So, bear this in mind when you have a hosting account with GoDaddy: if you are configuring your domains in your hosting account (either adding new ones, or adding a subdomain, or possibly removing some), the domain configuration application may reset any write permissions you may have set on folders. If you have one of these folders as an application root — and, really, there's no other reason to have write permissions set — then the application probably won't run properly. After you've finished configuring your domains, check any write permissions you may have set.

Now playing:
Heaven 17 - The Height of the Fighting(he-La-Hu)
(from Endless)



Share it: Digg It!  StumbleUpon  Reddit  Del.icio.us  NewsVine  Furl  BlinkList  Ma.gnolia  Technorati

About Me

I'm Julian M Bucknall, the M because it's my middle initial and because I and the other Julian Bucknall (the movie guy) would like to differentiate ourselves.

I'm a programmer by trade, an actor by ambition, and an algorithms guy by osmosis. I write articles for PCPlus in my spare time, not that there's much of that.

Julian M Bucknall Apart from that, an ex-pat Brit, atheist, microbrew enthusiast, Pet Shop Boys fanboy, slide rule and HP calculator collector, amateur photographer, Altoids muncher.

DevExpress

I'm Chief Technology Officer at Developer Express, a software company that writes some great controls and tools for .NET and Delphi. I'm responsible for the technology oversight and vision of the company.

The OUT Campaign

The OUT Campaign

Validation

Valid XHTML 1.0 Transitional     Valid CSS!

Bottom swirl

Archives

March 2010 (8)
SMTWTFS
« Feb  
123456
78910111213
14151617181920
21222324252627
28293031

Like this Archive Calendar widget? Download it here.

Search

Google ads

My Tweets

Bottom swirl